MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / from_str

Method from_str

ch_03/src/main.rs:40–45  ·  view source on GitHub ↗
(id: &str)

Source from the content-addressed store, hash-verified

38 type Err = std::io::Error;
39
40 fn from_str(id: &str) -> Result<Self, Self::Err> {
41 match id.is_empty() {
42 false => Ok(QuestionId(id.to_string())),
43 true => Err(Error::new(ErrorKind::InvalidInput, "No id provided")),
44 }
45 }
46}
47
48

Callers

nothing calls this directly

Calls 1

QuestionIdClass · 0.70

Tested by

no test coverage detected