ndb: make AsciiCharacter a CustomStringConvertible
This commit is contained in:
@@ -15,7 +15,7 @@ struct Reference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func to_referenced_id() -> ReferencedId {
|
func to_referenced_id() -> ReferencedId {
|
||||||
ReferencedId(ref_id: id.string(), relay_id: nil, key: key.string)
|
ReferencedId(ref_id: id.string(), relay_id: nil, key: key.description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
struct AsciiCharacter: ExpressibleByStringLiteral, Equatable, Hashable {
|
struct AsciiCharacter: ExpressibleByStringLiteral, CustomStringConvertible, Equatable, Hashable {
|
||||||
private let value: UInt8
|
private let value: UInt8
|
||||||
|
|
||||||
var cchar: CChar {
|
var cchar: CChar {
|
||||||
return CChar(bitPattern: value)
|
return CChar(bitPattern: value)
|
||||||
}
|
}
|
||||||
|
|
||||||
var string: String {
|
var description: String {
|
||||||
return String(UnicodeScalar(UInt8(bitPattern: cchar)))
|
return String(UnicodeScalar(UInt8(bitPattern: cchar)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user