arch-mirrors 0.1.1

Parse the Arch Linux mirror status.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Internal utilities meant to be only used within this crate.
pub trait StrExt<'a> {
    /// Convert a string into an [`Option`](Option).
    fn into_option(self) -> Option<&'a str>;
}

impl<'a> StrExt<'a> for &'a str {
    fn into_option(self) -> Option<&'a str> {
        match self.is_empty() {
            true => None,
            false => Some(self),
        }
    }
}