Skip to content

Commit 1b4608d

Browse files
committed
perf(core): remove wasteful clones
1 parent 8adb561 commit 1b4608d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/commands/ui/instance.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use {
1111
};
1212

1313
pub fn print(ctx: &Context, instance: &Instance, group_variant: &VersionGroupVariant) {
14-
match &instance.state.borrow().clone() {
14+
let state = instance.state.borrow();
15+
match &*state {
1516
InstanceState::Valid(ValidInstance::IsIgnored) => print_ignored(ctx, instance, group_variant),
1617
InstanceState::Valid(_) => print_valid(ctx, instance, group_variant),
1718
InstanceState::Invalid(InvalidInstance::Unfixable(_)) => print_unfixable(ctx, instance, group_variant),
@@ -145,7 +146,7 @@ pub fn get_location(ctx: &Context, instance: &Instance) -> String {
145146
}
146147

147148
fn get_state_name(instance: &Instance, group_variant: &VersionGroupVariant) -> String {
148-
let state = instance.state.borrow().clone();
149+
let state = instance.state.borrow();
149150
let state_name = state.get_name();
150151
// Issues related to whether a specifier is the highest or lowest semver are
151152
// all the same logic internally, so we have combined enum branches for

0 commit comments

Comments
 (0)