MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / from_str

Method from_str

crates/hyperqueue/src/client/commands/submit/command.rs:96–111  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

94 type Err = anyhow::Error;
95
96 fn from_str(s: &str) -> Result<Self, Self::Err> {
97 if s.is_empty() {
98 anyhow::bail!("Environment variable cannot be empty");
99 }
100 let var = match s.find('=') {
101 Some(position) => ArgEnvironmentVar {
102 key: s[..position].into(),
103 value: s[position + 1..].into(),
104 },
105 None => ArgEnvironmentVar {
106 key: s.into(),
107 value: Default::default(),
108 },
109 };
110 Ok(var)
111 }
112}
113
114#[derive(Clone, Debug, PartialEq)]

Callers

nothing calls this directly

Calls 4

parse_stdio_defFunction · 0.85
findMethod · 0.80
intoMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected