Skip to content

Commit 2b5720a

Browse files
committed
Remove i, is, u, or us suffixes that are not necessary.
1 parent 700c518 commit 2b5720a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+174
-174
lines changed

src/libcollections/fmt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
//! Some examples of the `format!` extension are:
2828
//!
2929
//! ```
30-
//! format!("Hello"); // => "Hello"
31-
//! format!("Hello, {}!", "world"); // => "Hello, world!"
30+
//! format!("Hello"); // => "Hello"
31+
//! format!("Hello, {}!", "world"); // => "Hello, world!"
3232
//! format!("The number is {}", 1); // => "The number is 1"
33-
//! format!("{:?}", (3, 4)); // => "(3, 4)"
33+
//! format!("{:?}", (3, 4)); // => "(3, 4)"
3434
//! format!("{value}", value=4); // => "4"
35-
//! format!("{} {}", 1, 2u); // => "1 2"
35+
//! format!("{} {}", 1, 2); // => "1 2"
3636
//! ```
3737
//!
3838
//! From these, you can see that the first argument is a format string. It is

src/libcore/char.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,18 +441,18 @@ pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> Option<usize> {
441441
dst[0] = code as u8;
442442
Some(1)
443443
} else if code < MAX_TWO_B && dst.len() >= 2 {
444-
dst[0] = (code >> 6u & 0x1F_u32) as u8 | TAG_TWO_B;
444+
dst[0] = (code >> 6 & 0x1F_u32) as u8 | TAG_TWO_B;
445445
dst[1] = (code & 0x3F_u32) as u8 | TAG_CONT;
446446
Some(2)
447447
} else if code < MAX_THREE_B && dst.len() >= 3 {
448-
dst[0] = (code >> 12u & 0x0F_u32) as u8 | TAG_THREE_B;
449-
dst[1] = (code >> 6u & 0x3F_u32) as u8 | TAG_CONT;
448+
dst[0] = (code >> 12 & 0x0F_u32) as u8 | TAG_THREE_B;
449+
dst[1] = (code >> 6 & 0x3F_u32) as u8 | TAG_CONT;
450450
dst[2] = (code & 0x3F_u32) as u8 | TAG_CONT;
451451
Some(3)
452452
} else if dst.len() >= 4 {
453-
dst[0] = (code >> 18u & 0x07_u32) as u8 | TAG_FOUR_B;
454-
dst[1] = (code >> 12u & 0x3F_u32) as u8 | TAG_CONT;
455-
dst[2] = (code >> 6u & 0x3F_u32) as u8 | TAG_CONT;
453+
dst[0] = (code >> 18 & 0x07_u32) as u8 | TAG_FOUR_B;
454+
dst[1] = (code >> 12 & 0x3F_u32) as u8 | TAG_CONT;
455+
dst[2] = (code >> 6 & 0x3F_u32) as u8 | TAG_CONT;
456456
dst[3] = (code & 0x3F_u32) as u8 | TAG_CONT;
457457
Some(4)
458458
} else {

src/liblibc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ pub mod types {
19301930
pub iSecurityScheme: c_int,
19311931
pub dwMessageSize: DWORD,
19321932
pub dwProviderReserved: DWORD,
1933-
pub szProtocol: [u8; WSAPROTOCOL_LEN as usize + 1us],
1933+
pub szProtocol: [u8; WSAPROTOCOL_LEN as usize + 1],
19341934
}
19351935

19361936
pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;

src/librbml/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ pub mod writer {
713713
match size {
714714
1 => w.write_all(&[0x80u8 | (n as u8)]),
715715
2 => w.write_all(&[0x40u8 | ((n >> 8) as u8), n as u8]),
716-
3 => w.write_all(&[0x20u8 | ((n >> 16) as u8), (n >> 8_u) as u8,
716+
3 => w.write_all(&[0x20u8 | ((n >> 16) as u8), (n >> 8) as u8,
717717
n as u8]),
718-
4 => w.write_all(&[0x10u8 | ((n >> 24) as u8), (n >> 16_u) as u8,
719-
(n >> 8_u) as u8, n as u8]),
718+
4 => w.write_all(&[0x10u8 | ((n >> 24) as u8), (n >> 16) as u8,
719+
(n >> 8) as u8, n as u8]),
720720
_ => Err(old_io::IoError {
721721
kind: old_io::OtherIoError,
722722
desc: "int too big",
@@ -863,7 +863,7 @@ pub mod writer {
863863
impl<'a, W: Writer + Seek> Encoder<'a, W> {
864864
// used internally to emit things like the vector length and so on
865865
fn _emit_tagged_uint(&mut self, t: EbmlEncoderTag, v: uint) -> EncodeResult {
866-
assert!(v <= 0xFFFF_FFFF_u);
866+
assert!(v <= 0xFFFF_FFFF);
867867
self.wr_tagged_u32(t as uint, v as u32)
868868
}
869869

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ pub fn parameterized<'tcx,GG>(cx: &ctxt<'tcx>,
560560
pub fn ty_to_short_str<'tcx>(cx: &ctxt<'tcx>, typ: Ty<'tcx>) -> String {
561561
let mut s = typ.repr(cx).to_string();
562562
if s.len() >= 32 {
563-
s = (&s[0u..32]).to_string();
563+
s = (&s[0..32]).to_string();
564564
}
565565
return s;
566566
}

src/librustc_trans/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
6262
let file = path.filename_str().unwrap();
6363
let file = &file[3..file.len() - 5]; // chop off lib/.rlib
6464
debug!("reading {}", file);
65-
for i in iter::count(0us, 1) {
65+
for i in iter::count(0, 1) {
6666
let bc_encoded = time(sess.time_passes(),
6767
&format!("check for {}.{}.bytecode.deflate", name, i),
6868
(),

src/librustc_trans/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ impl<'a, 'tcx> FunctionContext<'a, 'tcx> {
443443

444444
pub fn env_arg_pos(&self) -> uint {
445445
if self.caller_expects_out_pointer {
446-
1u
446+
1
447447
} else {
448-
0u
448+
0
449449
}
450450
}
451451

src/librustc_trans/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
467467
PointerCast(bcx, lval.val, type_of::type_of(bcx.ccx(), unsized_ty).ptr_to())
468468
}
469469
ty::UnsizeLength(..) => {
470-
GEPi(bcx, lval.val, &[0u, 0u])
470+
GEPi(bcx, lval.val, &[0, 0])
471471
}
472472
};
473473

src/librustc_trans/trans/tvec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn make_drop_glue_unboxed<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
7676
let not_empty = ICmp(bcx,
7777
llvm::IntNE,
7878
len,
79-
C_uint(ccx, 0us),
79+
C_uint(ccx, 0_u32),
8080
DebugLoc::None);
8181
with_cond(bcx, not_empty, |bcx| {
8282
let llalign = C_uint(ccx, machine::llalign_of_min(ccx, llty));
@@ -436,7 +436,7 @@ pub fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
436436
let loop_counter = {
437437
// i = 0
438438
let i = alloca(loop_bcx, bcx.ccx().int_type(), "__i");
439-
Store(loop_bcx, C_uint(bcx.ccx(), 0us), i);
439+
Store(loop_bcx, C_uint(bcx.ccx(), 0_u32), i);
440440

441441
Br(loop_bcx, cond_bcx.llbb, DebugLoc::None);
442442
i
@@ -464,7 +464,7 @@ pub fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
464464

465465
{ // i += 1
466466
let i = Load(inc_bcx, loop_counter);
467-
let plusone = Add(inc_bcx, i, C_uint(bcx.ccx(), 1us), DebugLoc::None);
467+
let plusone = Add(inc_bcx, i, C_uint(bcx.ccx(), 1_u32), DebugLoc::None);
468468
Store(inc_bcx, plusone, loop_counter);
469469

470470
Br(inc_bcx, cond_bcx.llbb, DebugLoc::None);

src/libstd/num/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ mod tests {
11491149
assert_eq!(_20, NumCast::from(20f32).unwrap());
11501150
assert_eq!(_20, NumCast::from(20f64).unwrap());
11511151

1152-
assert_eq!(_20, cast(20u).unwrap());
1152+
assert_eq!(_20, cast(20usize).unwrap());
11531153
assert_eq!(_20, cast(20u8).unwrap());
11541154
assert_eq!(_20, cast(20u16).unwrap());
11551155
assert_eq!(_20, cast(20u32).unwrap());
@@ -1763,7 +1763,7 @@ mod bench {
17631763

17641764
#[bench]
17651765
fn bench_pow_function(b: &mut Bencher) {
1766-
let v = (0..1024u).collect::<Vec<_>>();
1767-
b.iter(|| {v.iter().fold(0u, |old, new| old.pow(*new));});
1766+
let v = (0..1024).collect::<Vec<_>>();
1767+
b.iter(|| {v.iter().fold(0, |old, new| old.pow(*new));});
17681768
}
17691769
}

0 commit comments

Comments
 (0)