(s: &str)
| 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)] |
nothing calls this directly
no test coverage detected