Skip to content

Commit 3f88d6a

Browse files
Rollup merge of rust-lang#131359 - practicalrs:fix_used_underscore_binding, r=jieyouxu
Fix used_underscore_binding in rustc_serialize Hi, This PR fixes the following clippy warnings in rustc_serialize ``` warning: used underscore-prefixed binding --> compiler/rustc_serialize/src/opaque.rs:443:27 | 443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE); | ^^^^^^^^ | note: binding is defined here --> compiler/rustc_serialize/src/opaque.rs:442:13 | 442 | let _end_pos = e.position(); | ^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding = note: requested on the command line with `-W clippy::used-underscore-binding` warning: used underscore-prefixed binding --> compiler/rustc_serialize/src/opaque.rs:443:38 | 443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE); | ^^^^^^^^^^ | note: binding is defined here --> compiler/rustc_serialize/src/opaque.rs:440:13 | 440 | let _start_pos = e.position(); | ^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding ``` Best regards, Michal
2 parents f88bfa3 + 4085b48 commit 3f88d6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_serialize/src/opaque.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,10 @@ impl IntEncodedWithFixedSize {
437437
impl Encodable<FileEncoder> for IntEncodedWithFixedSize {
438438
#[inline]
439439
fn encode(&self, e: &mut FileEncoder) {
440-
let _start_pos = e.position();
440+
let start_pos = e.position();
441441
e.write_array(self.0.to_le_bytes());
442-
let _end_pos = e.position();
443-
debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
442+
let end_pos = e.position();
443+
debug_assert_eq!((end_pos - start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
444444
}
445445
}
446446

0 commit comments

Comments
 (0)