diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-04-27 14:08:52 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2022-04-29 15:03:45 -0400 |
commit | fead7107abc494ef051fd26357c21a546b49c7d9 (patch) | |
tree | 8605fc5e827abb03f2020193ba3f28ca2108147c /yjit/src/asm/x86_64/mod.rs | |
parent | f8e4488e5e01c07cc8c139e6030a5dfca45b824c (diff) |
YJIT: Adopt Clippy suggestions we like
This adopts most suggestions that rust-clippy is confident enough to
auto apply. The manual changes mostly fix manual if-lets and take
opportunities to use the `Default` trait on standard collections.
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5853
Diffstat (limited to 'yjit/src/asm/x86_64/mod.rs')
-rw-r--r-- | yjit/src/asm/x86_64/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yjit/src/asm/x86_64/mod.rs b/yjit/src/asm/x86_64/mod.rs index c748ec1154..902b3eb9cc 100644 --- a/yjit/src/asm/x86_64/mod.rs +++ b/yjit/src/asm/x86_64/mod.rs @@ -1295,12 +1295,12 @@ pub fn sub(cb: &mut CodeBlock, opnd0: X86Opnd, opnd1: X86Opnd) { fn resize_opnd(opnd: X86Opnd, num_bits: u8) -> X86Opnd { match opnd { X86Opnd::Reg(reg) => { - let mut cloned = reg.clone(); + let mut cloned = reg; cloned.num_bits = num_bits; X86Opnd::Reg(cloned) }, X86Opnd::Mem(mem) => { - let mut cloned = mem.clone(); + let mut cloned = mem; cloned.num_bits = num_bits; X86Opnd::Mem(cloned) }, |