MCPcopy Index your code
hub / github.com/endbasic/endbasic / split_uri

Function split_uri

std/src/storage/mod.rs:349–357  ·  view source on GitHub ↗

Given a mount URI, validates it and returns the `(scheme, path)` pair.

(uri: &str)

Source from the content-addressed store, hash-verified

347
348/// Given a mount URI, validates it and returns the `(scheme, path)` pair.
349fn 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.
360struct MountedDrive {

Callers 1

mountMethod · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected