pub trait PathExt {
// Required method
fn extensions_lossy(&self) -> ExtensionsLossy ⓘ;
}
Required Methods§
Sourcefn extensions_lossy(&self) -> ExtensionsLossy ⓘ
fn extensions_lossy(&self) -> ExtensionsLossy ⓘ
Returns an iterator over the extensions of a path, lossily converted.
use std::path::Path;
use path_utils::PathExt;
let path = Path::new("file.tar.gz");
let extensions = path.extensions_lossy().collect::<Vec<String>>();
assert_eq!(extensions, ["gz", "tar"]);