Serde-llsd - request review

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 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 return anyhow::Error
  • I don't understand the purpose of the various PREFIX and SENTINEL 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 with Ok(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 in ser::binary::generate_value
  • In de::binary the expression std::str::from_utf8(&read_variable(cursor)?)?.to_string() occurs several times—this also does an unnecessary allocation, you can replace it with String::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.