Given a mount URI, validates it and returns the `(scheme, path)` pair.
(uri: &str)
| 347 | |
| 348 | /// Given a mount URI, validates it and returns the `(scheme, path)` pair. |
| 349 | fn split_uri(uri: &str) -> io::Result<(&str, &str)> { |
| 350 | match uri.find("://") { |
| 351 | Some(pos) if pos > 0 => Ok((&uri[0..pos], &uri[pos + 3..])), |
| 352 | _ => Err(io::Error::new( |
| 353 | io::ErrorKind::InvalidInput, |
| 354 | "Mount URI must be of the form scheme://path", |
| 355 | )), |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /// Metadata for a mounted drive. |
| 360 | struct MountedDrive { |