json2: wrap Builder.free() calls inside unsafe (#8790)

pull/8796/head
Lukas Neubert 2021-02-17 01:19:26 +01:00 committed by GitHub
parent 2002d20249
commit e4a67dea37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -311,7 +311,7 @@ fn (mut p Parser) decode_string() ?Any {
}
p.next()
defer {
strwr.free()
unsafe { strwr.free() }
}
str := strwr.str()
return Any(str)

View File

@ -30,7 +30,7 @@ pub fn (flds map[string]Any) str() string {
}
wr.write_b(`}`)
defer {
wr.free()
unsafe { wr.free() }
}
res := wr.str()
return res
@ -45,7 +45,7 @@ pub fn (flds []Any) str() string {
}
wr.write_b(`]`)
defer {
wr.free()
unsafe { wr.free() }
}
res := wr.str()
return res