Skip to content

Commit 7b480f5

Browse files
committed
Lint
1 parent 2473ed9 commit 7b480f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Example/CodeEditSourceEditorExample/CodeEditSourceEditorExample/Documents/CodeEditSourceEditorExampleDocument.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ struct CodeEditSourceEditorExampleDocument: FileDocument {
2525
guard let data = configuration.file.regularFileContents else {
2626
throw CocoaError(.fileReadCorruptFile)
2727
}
28-
text = String(decoding: data, as: UTF8.self)
28+
text = String(data: data, encoding: .utf8)
2929
}
3030

3131
func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
32-
let data = text.data(using: .utf8)!
32+
let data = Data(text.utf8)
3333
return .init(regularFileWithContents: data)
3434
}
3535
}

Sources/CodeEditSourceEditor/Controller/TextViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public class TextViewController: NSViewController {
197197

198198
return max(inset, .zero)
199199
}
200-
200+
201201
/// The trailing inset for the editor. Grows when line wrapping is disabled.
202202
package var textViewTrailingInset: CGFloat {
203203
wrapLines ? 1 : 48

0 commit comments

Comments
 (0)