From 6fa074327dba7fe7b6dd5e825d91e2a1542681e8 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Tue, 18 Apr 2017 19:42:26 +0200 Subject: [PATCH] remove nsdata conveniences --- Sources/GenomeFoundation/Foundation.swift | 27 ----------------------- 1 file changed, 27 deletions(-) diff --git a/Sources/GenomeFoundation/Foundation.swift b/Sources/GenomeFoundation/Foundation.swift index cf32165..561f75e 100644 --- a/Sources/GenomeFoundation/Foundation.swift +++ b/Sources/GenomeFoundation/Foundation.swift @@ -16,30 +16,3 @@ extension Data: NodeConvertible { self = data } } - -// MARK: NSData - -extension NSData: NodeRepresentable { - public func makeNode(context: Context = EmptyNode) throws -> Node { - var bytes = [UInt8](repeating: 0, count: length) - getBytes(&bytes, length: bytes.count) - let data = Data(bytes: bytes) - let js = try JSONSerialization.jsonObject(with: data, options: .allowFragments) - return Node(any: js) - } -} - - -#if Xcode -/* -Linux won't compile this. -*/ -extension NSData: NodeConvertible {} -extension NodeConvertible where Self: NSData { - public init(node: Node, in context: Context) throws { - let any = node.any - let data = try JSONSerialization.data(withJSONObject: any, options: .init(rawValue: 0)) - self.init(data: data) - } -} -#endif