brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
87 stars 9 forks source link

Why `TryFrom<String>` not `TryFrom<&str>`? #53

Closed Eh2406 closed 2 years ago

Eh2406 commented 2 years ago

Why TryFrom<String> not TryFrom<&str>? For example here https://docs.rs/pasetors/0.5.0-alpha.5/src/pasetors/paserk.rs.html#129-141 Why do we need to own the string in order to convert it into a pasetors type?

brycx commented 2 years ago

There should be no reason and this should definitely be TryFrom<&str>. I don't know why this wasn't so to begin with.

brycx commented 2 years ago

Included in the latest prerelease: https://crates.io/crates/pasetors/0.5.0-alpha.6