PathExtension

Trait PathExtension 

Source
pub trait PathExtension {
    // Required method
    fn extension_as_lowercase(&self) -> Option<String>;
}
Expand description

Trait to extend Path with a convenient method for getting the lowercase file extension. Used by extension.rs, file_dialog.rs, filters.rs.

Required Methods§

Source

fn extension_as_lowercase(&self) -> Option<String>

Returns the file extension as a lowercase String, or None.

Implementations on Foreign Types§

Source§

impl PathExtension for Path

Source§

fn extension_as_lowercase(&self) -> Option<String>

Implementation for Path. Gets extension, converts to &str (lossy), then lowercases.

§Logic
  1. Call self.extension() -> Option<&OsStr>.
  2. Convert OsStr to &str via to_str -> Option<&str>.
  3. Map &str to lowercase String -> Option<String>.

Implementors§