(protocol: &str)
| 180 | } |
| 181 | |
| 182 | fn valid_protocol_or_error(protocol: &str) -> anyhow::Result<()> { |
| 183 | if !VALID_PROTOCOLS.contains(&protocol) { |
| 184 | Err(anyhow::anyhow!("Invalid protocol: {protocol}")) |
| 185 | } else { |
| 186 | Ok(()) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | pub async fn exec_add(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> { |
| 191 | // Trim trailing `/`s because otherwise we end up with a double `//` in some later codepaths. |