Streamline adding new URL types #122
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "117---streamline-adding-new-url-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #117
Also remove
tmp.json
.@ -21,2 +21,3 @@
pub sort: Option<ArtistId>,
pub properties: ArtistProperties,
pub musicbrainz: Option<MusicBrainz>,
#[serde(serialize_with = "ordered_map")]
This couples the on-disk database serialisation with the in-memory abstract representation. To be fair, it was always there under the subtle guise of
Serialize
/Deserialize
. Think whether to create the split here, or in a separate issue following this one.@ -191,2 +120,2 @@
container.retain(|url| !urls.contains(url));
Ok(())
pub fn remove_from_property<S: AsRef<str>>(&mut self, property: S, values: Vec<S>) {
let container = self.properties.get_mut(property.as_ref()).map(|container| {
Split map from the get_mut. Will be more legible and the container variable is used later anyway.
@ -193,0 +122,4 @@
container.retain(|val| !values.iter().any(|x| x.as_ref() == val));
container
});
if let Some(container) = container {
When addressing the comment above, move the retain operation to be inside this if-let.
@ -20,0 +22,4 @@
}
}
impl<K: Hash + PartialEq + Eq, V: Merge> Merge for HashMap<K, V> {
Is it possible to have a blanket merge with specialisations for ones that implement merge?
WIP: Streamline adding new URL typesto Streamline adding new URL types