MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / DoubleError

Enum DoubleError

0a_error_handling/rust/using_eyre/src/bin/thiserror.rs:5–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4#[derive(Error, Debug)]
5enum DoubleError {
6 #[error("no first item")]
7 EmptyVec,
8 #[error("invalid first item, error: '{0}'")]
9 Parse(#[from] std::num::ParseIntError),
10}
11
12fn double_first(vec: Vec<&str>) -> Result<i32> {
13 let first = vec.first().ok_or(DoubleError::EmptyVec)?;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected