1
0
Fork 0
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:
Matthias Ahouansou 2024-07-11 13:24:06 +01:00
parent 3bf113d920
commit e3cfe360a1
No known key found for this signature in database

View file

@ -29,13 +29,7 @@ impl From<Metadata> for Restriction {
),
]
.into_iter()
.find(|(other, _)| {
metadata
.history
.stable_paths()
.zip(other.history.stable_paths())
.all(|(a, b)| a == b)
})
.find(|(other, _)| metadata.history.all_paths().eq(other.history.all_paths()))
.map(|(_, restriction)| restriction)
.unwrap_or_default()
}