]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
macOS: Syntax highlighter: Swift can bridge c strings automatically
authorRoopesh Chander <roop@roopc.net>
Fri, 22 Mar 2019 10:01:02 +0000 (15:31 +0530)
committerRoopesh Chander <roop@roopc.net>
Fri, 22 Mar 2019 10:01:02 +0000 (15:31 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift

index 077ee1eea932085e00f7b871b43c16a497543f53..2219759ee0195bac6df6830237fdfdf2b2c71b3f 100644 (file)
@@ -143,7 +143,7 @@ class ConfTextStorage: NSTextStorage {
             .font: defaultFont
         ]
         backingStore.setAttributes(defaultAttributes, range: fullTextRange)
-        var spans = highlight_config(backingStore.string.cString(using: String.Encoding.utf8))!
+        var spans = highlight_config(backingStore.string)!
         evaluateExcludePrivateIPs(highlightSpans: spans)
 
         while spans.pointee.type != HighlightEnd {