&static str
Open
- Dominant language
- Rust
- Stars
- 5.5k
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
The following code is a common way to return value:
```rsut
fn parse_version(header: &[u8]) -> Result {
match header.get(0) {
None => Err("invalid header length"),
Some(&1) => Ok(Version::Version1),
Some(&2) => Ok(Version::Version2),
Some(_) => Err("invalid version"),
}
}
```
By this way, the error will be returned as a `&'static str` and we can return any errors with this way, what's the advantage of `thiserror` over `&'static str`?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.