Skip to content

Commit

Permalink
Made data a BSON Primitive again
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Apr 18, 2017
1 parent 4d9d71f commit 889a1a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/BSON/BSONPrimitive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ public struct Timestamp: SimplePrimitive, Equatable {
}
}

extension Data : SimplePrimitive {
public var typeIdentifier: Byte {
return 0x05
}

public func makeBinary() -> Bytes {
return Binary(data: self, withSubtype: .generic).makeBinary()
}
}

public struct Binary: SimplePrimitive {
public func convert<S>(_ type: S.Type) -> S? {
if self is S {
Expand Down

0 comments on commit 889a1a6

Please sign in to comment.