mirror of
git://jb55.com/damus
synced 2024-09-30 00:40:45 +00:00
ndb: make AsciiCharacter a CustomStringConvertible
This commit is contained in:
parent
07dfa3b1fb
commit
6e6c1eb7b6
@ -15,7 +15,7 @@ struct Reference {
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
struct AsciiCharacter: ExpressibleByStringLiteral, Equatable, Hashable {
|
||||
struct AsciiCharacter: ExpressibleByStringLiteral, CustomStringConvertible, Equatable, Hashable {
|
||||
private let value: UInt8
|
||||
|
||||
var cchar: CChar {
|
||||
return CChar(bitPattern: value)
|
||||
}
|
||||
|
||||
var string: String {
|
||||
var description: String {
|
||||
return String(UnicodeScalar(UInt8(bitPattern: cchar)))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user