Use fully-qualified paths for wrap_impl! macro

This commit is contained in:
Alexandre Bury 2020-06-09 09:17:07 -07:00
parent a68e237c81
commit aeb9b2af7b

View File

@ -169,25 +169,25 @@ macro_rules! wrap_impl {
(self.$v:ident: $t:ty) => {
type V = $t;
fn with_view<F, R>(&self, f: F) -> Option<R>
fn with_view<F, R>(&self, f: F) -> std::option::Option<R>
where
F: FnOnce(&Self::V) -> R,
F: std::ops::FnOnce(&Self::V) -> R,
{
Some(f(&self.$v))
std::option::Option::Some(f(&self.$v))
}
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R>
fn with_view_mut<F, R>(&mut self, f: F) -> std::option::Option<R>
where
F: FnOnce(&mut Self::V) -> R,
F: std::ops::FnOnce(&mut Self::V) -> R,
{
Some(f(&mut self.$v))
std::option::Option::Some(f(&mut self.$v))
}
fn into_inner(self) -> Result<Self::V, Self>
fn into_inner(self) -> std::result::Result<Self::V, Self>
where
Self::V: Sized,
{
Ok(self.$v)
std::result::Result::Ok(self.$v)
}
};
}