Fix snapshot clippy lints (#685)

The sixth in a series of PRs that aim to get CI passing
This commit is contained in:
Kenneth Loeffler
2023-06-30 11:05:55 -07:00
committed by GitHub
parent 5b1a090c5e
commit a2f68c2e3c
3 changed files with 7 additions and 10 deletions

View File

@@ -97,8 +97,7 @@ fn finalize_patch_application(context: PatchApplyContext, tree: &mut RojoTree) -
for value in instance.properties_mut().values_mut() { for value in instance.properties_mut().values_mut() {
if let Variant::Ref(referent) = value { if let Variant::Ref(referent) = value {
if let Some(&instance_referent) = context.snapshot_id_to_instance_id.get(&referent) if let Some(&instance_referent) = context.snapshot_id_to_instance_id.get(referent) {
{
*value = Variant::Ref(instance_referent); *value = Variant::Ref(instance_referent);
} }
} }

View File

@@ -26,10 +26,8 @@ pub fn compute_patch_set(snapshot: Option<InstanceSnapshot>, tree: &RojoTree, id
// for all of the IDs that we know about so far. // for all of the IDs that we know about so far.
rewrite_refs_in_updates(&context, &mut patch_set.updated_instances); rewrite_refs_in_updates(&context, &mut patch_set.updated_instances);
rewrite_refs_in_additions(&context, &mut patch_set.added_instances); rewrite_refs_in_additions(&context, &mut patch_set.added_instances);
} else { } else if id != tree.get_root_id() {
if id != tree.get_root_id() { patch_set.removed_instances.push(id);
patch_set.removed_instances.push(id);
}
} }
patch_set patch_set

View File

@@ -37,8 +37,8 @@ pub struct RojoTree {
impl RojoTree { impl RojoTree {
pub fn new(snapshot: InstanceSnapshot) -> RojoTree { pub fn new(snapshot: InstanceSnapshot) -> RojoTree {
let root_builder = InstanceBuilder::new(snapshot.class_name.to_owned()) let root_builder = InstanceBuilder::new(snapshot.class_name)
.with_name(snapshot.name.to_owned()) .with_name(snapshot.name)
.with_properties(snapshot.properties); .with_properties(snapshot.properties);
let mut tree = RojoTree { let mut tree = RojoTree {
@@ -245,7 +245,7 @@ impl<'a> InstanceWithMeta<'a> {
} }
pub fn metadata(&self) -> &'a InstanceMetadata { pub fn metadata(&self) -> &'a InstanceMetadata {
&self.metadata self.metadata
} }
} }
@@ -294,6 +294,6 @@ impl InstanceWithMetaMut<'_> {
} }
pub fn metadata(&self) -> &InstanceMetadata { pub fn metadata(&self) -> &InstanceMetadata {
&self.metadata self.metadata
} }
} }