chore: Remove explicit clones in value

This commit is contained in:
EmperorBale 2021-12-06 17:18:35 -08:00 committed by Adrian Wielgosik
parent 1709ea94e7
commit 847a4fb61a
1 changed files with 4 additions and 4 deletions

View File

@ -299,7 +299,7 @@ impl<'gc> Value<'gc> {
match self { match self {
Value::Object(o) if hint == Hint::String => { Value::Object(o) if hint == Hint::String => {
let mut prim = self.clone(); let mut prim = *self;
let object = *o; let object = *o;
if let Value::Object(_) = if let Value::Object(_) =
@ -333,7 +333,7 @@ impl<'gc> Value<'gc> {
Err("TypeError: cannot convert object to string".into()) Err("TypeError: cannot convert object to string".into())
} }
Value::Object(o) if hint == Hint::Number => { Value::Object(o) if hint == Hint::Number => {
let mut prim = self.clone(); let mut prim = *self;
let object = *o; let object = *o;
if let Value::Object(_) = if let Value::Object(_) =
@ -366,7 +366,7 @@ impl<'gc> Value<'gc> {
Err("TypeError: cannot convert object to number".into()) Err("TypeError: cannot convert object to number".into())
} }
_ => Ok(self.clone()), _ => Ok(*self),
} }
} }
@ -571,7 +571,7 @@ impl<'gc> Value<'gc> {
_ => {} _ => {}
}; };
PrimitiveObject::from_primitive(self.clone(), activation) PrimitiveObject::from_primitive(*self, activation)
} }
/// Coerce the value to another value by type name. /// Coerce the value to another value by type name.