iter: make safer by using NdbNote instead of unsafe pointers

If we have an owned note, we could lose track of the lifetime and then
crash. Let's make sure we always have an NdbNote instead
This commit is contained in:
William Casarin
2023-07-22 16:56:13 -07:00
parent af7ea7024f
commit 58e2fb40ef
4 changed files with 35 additions and 13 deletions

View File

@@ -34,7 +34,7 @@ struct NdbNote {
}
func tags() -> TagsSequence {
return .init(note: note)
return .init(note: self)
}
static func owned_from_json(json: String, bufsize: Int = 2 << 18) -> NdbNote? {