fn virtualise_path(path: &Path, file_type: FileType) -> VirtualPath {
    let mut path = path.to_path_buf();
    let path = match file_type {
        FileType::Root => {
            path.pop();
            path
        }
        FileType::Normal => {
            let base = path.parent().unwrap();
            let path_no_ext: PathBuf = path
                .file_stem()
                .expect("ice: this should have been the path to a file")
                .into();
            base.join(path_no_ext)
        }
    };
    VirtualPath(path)
}
/// Takes a path to a noir file. This will panic on paths to directories
/// Returns
/// For Normal filetypes, given "src/mod.nr" this method returns "src/mod"
/// For Root filetypes, given "src/mod.nr" this method returns "src"
Takes a path to a noir file.
Takes a path to a noir file .
fn virtualise_path(path: &Path, file_type: FileType) -> VirtualPath {
    let mut path = path.to_path_buf();
    let path = match file_type {
        FileType::Root => {
            path.pop();
            path
        }
        FileType::Normal => {
            let base = path.parent().unwrap();
            let path_no_ext: PathBuf = path
                .file_stem()
                .expect("ice: this should have been the path to a file")
                .into();
            base.join(path_no_ext)
        }
    };
    VirtualPath(path)
}
fn virtualise_path ( path : & Path , file_type : FileType ) -> VirtualPath { let mut path = path . to_path_buf ( ) ; let path = match file_type { FileType :: Root => { path . pop ( ) ; path } FileType :: Normal => { let base = path . parent ( ) . unwrap ( ) ; let path_no_ext : PathBuf = path . file_stem ( ) . expect ( " " ) . into ( ) ; base . join ( path_no_ext ) } } ; VirtualPath ( path ) }
Takes a path to a noir file.
Takes a path to a noir file .
path
&Path
file_type
FileType
path
&Path
file_type
FileType