1
0
mirror of git://jb55.com/damus synced 2024-09-29 16:30:44 +00:00

ndb: make AsciiCharacter a CustomStringConvertible

This commit is contained in:
William Casarin 2023-08-01 16:28:48 -07:00
parent 07dfa3b1fb
commit 6e6c1eb7b6
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}
}

View File

@ -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)))
}