Hi, The following code is a common way to return value: ```rsut fn parse_version(header: &[u8]) -> Result<Version, &'static str> { 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`?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by wangjiawen2013 and has received 0 comments.