ToStrings

Trait ToStrings 

Source
pub trait ToStrings {
    // Required method
    fn to_strings(&self) -> Vec<String>;

    // Provided method
    fn to_absolute_strings(&self) -> Vec<String> { ... }
}
Expand description

Trait for converting a vector of PathBufs to a vector of strings

Required Methods§

Source

fn to_strings(&self) -> Vec<String>

Convert a vector of string slices to a vector of string values of paths

This is a convenience that I find myself wanting to use in a lot of places.

Adding a to_strings method to the Vec<PathBuf> types seems like a good idea.

§Example
use acorn_lib::util::ToStrings;

let paths = vec![PathBuf::from("foo"), PathBuf::from("bar"), PathBuf::from("baz")];
assert!(paths.to_strings().contains(&"foo".to_string()));

Provided Methods§

Source

fn to_absolute_strings(&self) -> Vec<String>

Convert a vector of string slices to a vector of string values of absolute paths

Implementations on Foreign Types§

Source§

impl<P: Into<PathBuf> + Clone> ToStrings for Vec<P>

Implementors§