Fix a couple of warnings

This commit is contained in:
Stefan Ceriu
2026-02-02 10:00:08 +02:00
committed by Stefan Ceriu
parent c18b4b4f70
commit 37ee5c9c7e
5 changed files with 8 additions and 11 deletions
@@ -99,7 +99,11 @@ enum HTMLFixtures: String, CaseIterable {
""" """
case .wideCodeBlock: case .wideCodeBlock:
""" """
<pre><code>CHHapticPattern.mm:487 +[CHHapticPattern patternForKey:error:]: Failed to read pattern library data: Error Domain=NSCocoaErrorDomain Code=260 "The file “hapticpatternlibrary.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSURL=file:///Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSUnderlyingError=0x600000da69d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}</code></pre> <pre><code>CHHapticPattern.mm:487 +[CHHapticPattern patternForKey:error:]: Failed to read pattern library data: Error Domain=NSCocoaErrorDomain Code=260 \
"The file “hapticpatternlibrary.plist” couldn’t be opened because there is no such file." \
UserInfo={NSFilePath=/Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, \
NSURL=file:///Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, \
NSUnderlyingError=0x600000da69d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}</code></pre>
""" """
case .unorderedList: case .unorderedList:
""" """
@@ -86,14 +86,10 @@ struct CompletionSuggestionView: View {
} }
private struct BackgroundView<Content: View>: View { private struct BackgroundView<Content: View>: View {
var content: () -> Content @ViewBuilder var content: () -> Content
private let shadowRadius: CGFloat = 20.0 private let shadowRadius: CGFloat = 20.0
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
var body: some View { var body: some View {
content() content()
.background(Color.compound.bgSubtlePrimary) .background(Color.compound.bgSubtlePrimary)
@@ -148,7 +148,6 @@ class ComposerToolbarViewModelTests: XCTestCase {
viewModel.context.send(viewAction: .selectedSuggestion(suggestion)) viewModel.context.send(viewAction: .selectedSuggestion(suggestion))
var string = "@room" var string = "@room"
// swiftlint:disable:next force_unwrapping
try string.unicodeScalars.append(XCTUnwrap(UnicodeScalar(String.nbsp))) try string.unicodeScalars.append(XCTUnwrap(UnicodeScalar(String.nbsp)))
XCTAssertEqual(wysiwygViewModel.content.html, string) XCTAssertEqual(wysiwygViewModel.content.html, string)
} }
@@ -86,9 +86,9 @@ class SpaceAddRoomsScreenViewModelTests: XCTestCase {
// Then the screen should be updated to only show the rooms that still need to be added. // Then the screen should be updated to only show the rooms that still need to be added.
XCTAssertEqual(spaceServiceProxy.addChildToCallsCount, 3, "The remaining calls to the service should stop after a failure.") XCTAssertEqual(spaceServiceProxy.addChildToCallsCount, 3, "The remaining calls to the service should stop after a failure.")
XCTAssertFalse(context.viewState.selectedRooms.contains(where: { successfulIDs.contains($0.id) }), XCTAssertFalse(context.viewState.selectedRooms.contains { successfulIDs.contains($0.id) },
"The added rooms should no longer show as selected.") "The added rooms should no longer show as selected.")
XCTAssertFalse(context.viewState.roomsSection.rooms.contains(where: { successfulIDs.contains($0.id) }), XCTAssertFalse(context.viewState.roomsSection.rooms.contains { successfulIDs.contains($0.id) },
"The added rooms should no longer be listed for selection.") "The added rooms should no longer be listed for selection.")
} }
@@ -238,7 +238,6 @@ class TimelineViewModelTests: XCTestCase {
// MARK: - Read Receipts // MARK: - Read Receipts
// swiftlint:disable force_unwrapping
func testSendReadReceipt() async throws { func testSendReadReceipt() async throws {
// Given a room with only text items in the timeline // Given a room with only text items in the timeline
let items = [TextRoomTimelineItem(eventID: "t1"), let items = [TextRoomTimelineItem(eventID: "t1"),
@@ -284,7 +283,6 @@ class TimelineViewModelTests: XCTestCase {
try await Task.sleep(for: .milliseconds(100)) try await Task.sleep(for: .milliseconds(100))
} }
// swiftlint:enable force_unwrapping
// swiftlint:disable:next large_tuple // swiftlint:disable:next large_tuple
private func readReceiptsConfiguration(with items: [RoomTimelineItemProtocol]) -> (TimelineViewModel, private func readReceiptsConfiguration(with items: [RoomTimelineItemProtocol]) -> (TimelineViewModel,
JoinedRoomProxyMock, JoinedRoomProxyMock,