mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-08-01 17:38:36 +00:00
simplify conversion to restriction
This commit is contained in:
parent
3bf113d920
commit
e3cfe360a1
1 changed files with 1 additions and 7 deletions
|
@ -29,13 +29,7 @@ impl From<Metadata> for Restriction {
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.find(|(other, _)| {
|
.find(|(other, _)| metadata.history.all_paths().eq(other.history.all_paths()))
|
||||||
metadata
|
|
||||||
.history
|
|
||||||
.stable_paths()
|
|
||||||
.zip(other.history.stable_paths())
|
|
||||||
.all(|(a, b)| a == b)
|
|
||||||
})
|
|
||||||
.map(|(_, restriction)| restriction)
|
.map(|(_, restriction)| restriction)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue