Adding in some more implementations for AsOptionStr
This commit is contained in:
parent
3082edde66
commit
d16018dedb
|
@ -36,6 +36,20 @@ pub trait AsOptionStr {
|
|||
fn as_option_str(&self) -> Option<&str>;
|
||||
}
|
||||
|
||||
impl AsOptionStr for String {
|
||||
#[inline]
|
||||
fn as_option_str(&self) -> Option<&str> {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AsOptionStr for &'a str {
|
||||
#[inline]
|
||||
fn as_option_str(&self) -> Option<&str> {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl AsOptionStr for Option<String> {
|
||||
#[inline]
|
||||
fn as_option_str(&self) -> Option<&str> {
|
||||
|
|
Loading…
Reference in New Issue