This is a Serde library for Linden Lab Serial Data, used by various "metaverse" systems. I plan to make this a crate and submit it to crates.io. What needs to be fixed first? Thanks.
1 Like
Just looking at the public API/generated docs:
- you have an
error
module, but it's empty, and all the functions returnanyhow::Error
- I don't understand the purpose of the various
PREFIX
andSENTINEL
constants—do they need to be public at all?
Edit: more comments on reading the source code
- You can avoid an unnecessary allocation in
ser::xml::to_string
by replacing the last line withOk(String::from_utf8(s)?)
- In
ser::xml::generate_value
it seems like you're ignoring all write errors, even though the only calling function (to_writer
) can return an error—you should probably propagate write errors instead, as you do inser::binary::generate_value
- In
de::binary
the expressionstd::str::from_utf8(&read_variable(cursor)?)?.to_string()
occurs several times—this also does an unnecessary allocation, you can replace it withString::from_utf8(read_variable(cursor)?)?
Open-ended question, what does serde think about publishing crates with serde- prefix? I get that they can't and haven't been able to stop it, but what's the best thing to do? Use that name or another?
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.