pub fn from_path(root: impl AsRef<Path>, module: impl AsRef<Path>) -> Result<Self> {
        let relpath = {
            match module.as_ref().strip_prefix(root) {
                Ok(path) => path,
                Err(_) => return Err(Error::EvalModule(anyhow!("stripping prefix failed"))),
            }
        };

        Self::new(Path::new("/").join(relpath))
    }
/// Create a canonical ModuleId from a module path given the root directory
/// containing all modules.
Create a canonical ModuleId from a module path given the root directory
containing all modules.
Create a canonical ModuleId from a module path given the root directory containing all modules .
pub fn from_path(root: impl AsRef<Path>, module: impl AsRef<Path>) -> Result<Self> {
        let relpath = {
            match module.as_ref().strip_prefix(root) {
                Ok(path) => path,
                Err(_) => return Err(Error::EvalModule(anyhow!("stripping prefix failed"))),
            }
        };
        Self::new(Path::new("/").join(relpath))
    }
pub fn from_path ( root : impl AsRef < Path > , module : impl AsRef < Path > ) -> Result < Self > { let relpath = { match module . as_ref ( ) . strip_prefix ( root ) { Ok ( path ) => path , Err ( _ ) => return Err ( Error :: EvalModule ( anyhow ! ( " " ) ) ) , } } ; Self :: new ( Path :: new ( " " ) . join ( relpath ) ) }
Create a canonical ModuleId from a module path given the root directory
containing all modules.
Create a canonical ModuleId from a module path given the root directory containing all modules .
root
impl AsRef<Path>
module
impl AsRef<Path>
root
impl AsRef<Path>
module
impl AsRef<Path>