crdt: Small simplification in `Redactable`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
15f183ac7d
commit
60d95ebbd8
|
|
@ -47,10 +47,7 @@ impl<T> From<Redactable<T>> for Option<T> {
|
||||||
|
|
||||||
impl<'a, T> From<&'a Redactable<T>> for Option<&'a T> {
|
impl<'a, T> From<&'a Redactable<T>> for Option<&'a T> {
|
||||||
fn from(redactable: &'a Redactable<T>) -> Self {
|
fn from(redactable: &'a Redactable<T>) -> Self {
|
||||||
match redactable {
|
redactable.get()
|
||||||
Redactable::Present(v) => Some(v),
|
|
||||||
Redactable::Redacted => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue