pub fn source_to_device_path<S: AsRef<str>>(src: S) -> Result<PathBuf> {
    if let Some(label) = src.as_ref().strip_prefix("LABEL=") {
        // This is a very rudimentary level of support for disk labels.
        // It should probably be using libblkid proper, but this works for the
        // current system setups at least.
        return Ok(format!("/dev/disk/by-label/{}", blkid_encode_string(label)).into());
    }
    // Assume that src is some opaque value that the kernel will know what to do
    // with.
    Ok(src.as_ref().into())
}
/// Parse the source argument into a path where the source device should be
/// mounted. This handles things like LABELs as well as full paths.
Parse the source argument into a path where the source device should be
mounted. This handles things like LABELs as well as full paths.
Parse the source argument into a path where the source device should be mounted . This handles things like LABELs as well as full paths .
pub fn source_to_device_path<S: AsRef<str>>(src: S) -> Result<PathBuf> {
    if let Some(label) = src.as_ref().strip_prefix("LABEL=") {
        // This is a very rudimentary level of support for disk labels.
        // It should probably be using libblkid proper, but this works for the
        // current system setups at least.
        return Ok(format!("/dev/disk/by-label/{}", blkid_encode_string(label)).into());
    }
    // Assume that src is some opaque value that the kernel will know what to do
    // with.
    Ok(src.as_ref().into())
}
pub fn source_to_device_path < S : AsRef < str > > ( src : S ) -> Result < PathBuf > { if let Some ( label ) = src . as_ref ( ) . strip_prefix ( " " ) { // This is a very rudimentary level of support for disk labels. // It should probably be using libblkid proper, but this works for the // current system setups at least. return Ok ( format ! ( " " blkid_encode_string ( label ) ) . into ( ) ) ; } // Assume that src is some opaque value that the kernel will know what to do // with. Ok ( src . as_ref ( ) . into ( ) ) }
Parse the source argument into a path where the source device should be
mounted.
Parse the source argument into a path where the source device should be mounted .
src
S
src
S