You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
354 B
Rust

mod duration;
pub use duration::Duration;
#[derive(Debug)]
pub struct FromStrError {
msg: String,
}
fn from_str_error<T, O>(msg: O) -> FromStrError
where
T: Into<String>,
O: Into<Option<T>>,
{
let msg = msg
.into()
.map(|t| t.into())
.unwrap_or_else(|| String::from("Invalid value"));
FromStrError { msg }
}