fix: add missing s! in UInt64.fromJson? (#11237)

This PR fixes the error thrown by `UInt64.fromJson?` and
`USize.fromJson?` to use the missing `s!`.
This commit is contained in:
Jovan Gerbscheid 2025-11-18 10:31:31 +00:00 committed by GitHub
parent f6e580ccf8
commit 4c972ba0d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,7 +155,7 @@ def bignumToJson (n : Nat) : Json :=
protected def _root_.USize.fromJson? (j : Json) : Except String USize := do
let n ← bignumFromJson? j
if n ≥ USize.size then
throw "value '{j}' is too large for `USize`"
throw s!"value '{j}' is too large for `USize`"
return USize.ofNat n
instance : FromJson USize where
@ -167,7 +167,7 @@ instance : ToJson USize where
protected def _root_.UInt64.fromJson? (j : Json) : Except String UInt64 := do
let n ← bignumFromJson? j
if n ≥ UInt64.size then
throw "value '{j}' is too large for `UInt64`"
throw s!"value '{j}' is too large for `UInt64`"
return UInt64.ofNat n
instance : FromJson UInt64 where