clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

Remove some Identity conversions that could panic #1966

Open jsdt opened 1 week ago

jsdt commented 1 week ago

Description of Changes

This removes Identity::{from_slice,from_be_slice}, which previously had the potential to panic. Since callers can just use try_into, I don't think we need this in the API.

API and ABI breaking changes

This removes two functions from the Identity lib. If we find that these are widely used, we could add back a safe version. Making this safe will always be a breaking change though, since we need to change the return type to a Result.

Expected complexity level and risk

1

Testing

Not much added testing, since this is a pretty mechanical change.

gefjon commented 1 week ago

Spurious test failure should be fixed by #1979 . Please rebase onto master or merge master into this branch, at your preference, to confirm.