Parse an upload spec like ` [: ]` into (`local_path`, `optional_sandbox_path`).
(spec: &str)
| 3168 | |
| 3169 | /// Parse an upload spec like `<local>[:<remote>]` into (`local_path`, `optional_sandbox_path`). |
| 3170 | fn parse_upload_spec(spec: &str) -> (String, Option<String>) { |
| 3171 | if let Some((local, remote)) = spec.split_once(':') { |
| 3172 | ( |
| 3173 | local.to_string(), |
| 3174 | if remote.is_empty() { |
| 3175 | None |
| 3176 | } else { |
| 3177 | Some(remote.to_string()) |
| 3178 | }, |
| 3179 | ) |
| 3180 | } else { |
| 3181 | (spec.to_string(), None) |
| 3182 | } |
| 3183 | } |
| 3184 | |
| 3185 | #[cfg(test)] |
| 3186 | mod tests { |