async fn known_filesystems() -> Result<HashSet<FileSystem>> {
    rt::spawn_blocking(|| {
        let file = fs::File::open(rt::linux::procfs_root().join("filesystems"))?;
        let reader = io::BufReader::new(file);
        let mut acc = HashSet::with_capacity(4);

        for line in reader.lines() {
            let line = line?;
            let mut parts = line.splitn(2, '\t');

            #[allow(clippy::match_like_matches_macro)] // >= 1.42.0
            let nodev = match parts.next() {
                Some("nodev") => true,
                _ => false,
            };

            let fs = match parts.next() {
                Some("zfs") if nodev => FileSystem::from_str("zfs"),
                Some(filesystem) if !nodev => FileSystem::from_str(filesystem),
                _ => continue,
            }?;

            let _ = acc.insert(fs);
        }

        Ok(acc)
    })
    .await
}
// Returns stream with known physical (only!) partitions
Returns stream with known physical (only!) partitions
Returns stream with known physical ( only! ) partitions
async fn known_filesystems() -> Result<HashSet<FileSystem>> {
    rt::spawn_blocking(|| {
        let file = fs::File::open(rt::linux::procfs_root().join("filesystems"))?;
        let reader = io::BufReader::new(file);
        let mut acc = HashSet::with_capacity(4);
        for line in reader.lines() {
            let line = line?;
            let mut parts = line.splitn(2, '\t');
            #[allow(clippy::match_like_matches_macro)] // >= 1.42.0
            let nodev = match parts.next() {
                Some("nodev") => true,
                _ => false,
            };
            let fs = match parts.next() {
                Some("zfs") if nodev => FileSystem::from_str("zfs"),
                Some(filesystem) if !nodev => FileSystem::from_str(filesystem),
                _ => continue,
            }?;
            let _ = acc.insert(fs);
        }
        Ok(acc)
    })
    .await
}
async fn known_filesystems ( ) -> Result < HashSet < FileSystem > > { rt :: spawn_blocking ( | | { let file = fs :: File :: open ( rt :: linux :: procfs_root ( ) . join ( " " ) ) ? ; let reader = io :: BufReader :: new ( file ) ; let mut acc = HashSet :: with_capacity ( 4 ) ; for line in reader . lines ( ) { let line = line ? ; let mut parts = line . splitn ( 2 , '\t' ) ; # [ allow ( clippy match_like_matches_macro ) ] // >= 1.42.0 let nodev = match parts . next ( ) { Some ( " " ) => true , _ => false , } ; let fs = match parts . next ( ) { Some ( " " ) if nodev => FileSystem :: from_str ( " " ) , Some ( filesystem ) if ! nodev => FileSystem :: from_str ( filesystem ) , _ => continue , } ? ; let _ = acc . insert ( fs ) ; } Ok ( acc ) } ) . await }
Returns stream with known physical (only!)
Returns stream with known physical ( only! )