Skip to content

Commit

Permalink
[serialize] fix serialization for char
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Sep 21, 2024
1 parent 769b3a3 commit 87cf7d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nimhdf5/serialize.nim
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ proc fromH5*[T: char | string | cstring | bool](h5f: H5File, res: var T, name =
res = parseBool(obj.attrs[name, string])
elif T is char:
let s = obj.attrs[name, string]
doASsert s.len == 0, "Trying to read a char from a string with more than one element."
doAssert s.len == 1, "Trying to read a char from a string with more than one element."
res = s[0]
elif T is string:
res = obj.attrs[name, string]
Expand Down

0 comments on commit 87cf7d1

Please sign in to comment.