From 002aff70aff0309665f22c259929b866fdfc2ae0 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Fri, 6 Sep 2024 14:20:08 +0200 Subject: [PATCH] clips --- core/src/model/graph.rs | 8 ++++---- core/src/model/patch.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/model/graph.rs b/core/src/model/graph.rs index b395c72519..15c83ef00c 100644 --- a/core/src/model/graph.rs +++ b/core/src/model/graph.rs @@ -570,16 +570,16 @@ where } /// generates a name for a new node in the model that will not conflict (by suffixing with a - /// dot and number) + /// dot and number) pub fn unique_name<'n>(&self, prefix: impl Into>) -> Cow<'n, str> { let prefix = prefix.into(); - if self.nodes.iter().all(|n| n.name != &*prefix) { + if self.nodes.iter().all(|n| n.name != *prefix) { return prefix; } for i in 1.. { let s = format!("{prefix}.{i}"); - if self.nodes.iter().all(|n| n.name != s) { - return Cow::Owned(s) + if self.nodes.iter().all(|n| n.name != s) { + return Cow::Owned(s); } } unreachable!(); diff --git a/core/src/model/patch.rs b/core/src/model/patch.rs index 6763376a86..b3e2b48be5 100644 --- a/core/src/model/patch.rs +++ b/core/src/model/patch.rs @@ -258,7 +258,7 @@ where inputs: &[OutletId], ) -> TractResult> { let mut name = name.into(); - if self.nodes.iter().any(|n| n.name == &*name) { + if self.nodes.iter().any(|n| n.name == *name) { for i in 1.. { let s = format!("{name}#{i}"); if self.nodes.iter().all(|n| n.name != s) {