Skip to content

Commit e240cb9

Browse files
committed
Audit core::default for int/uint usage.
* Use `i32` (`u32`) in doc examples, not `int` (`u32`). * Switch impl macros to use `isize`/`usize` rather than `int`/`uint`.
1 parent 343909b commit e240cb9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libcore/default.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//!
1717
//! ```
1818
//! struct SomeOptions {
19-
//! foo: int,
19+
//! foo: i32,
2020
//! bar: f32,
2121
//! }
2222
//! ```
@@ -28,7 +28,7 @@
2828
//!
2929
//! #[derive(Default)]
3030
//! struct SomeOptions {
31-
//! foo: int,
31+
//! foo: i32,
3232
//! bar: f32,
3333
//! }
3434
//!
@@ -56,7 +56,7 @@
5656
//!
5757
//! #[derive(Default)]
5858
//! struct SomeOptions {
59-
//! foo: int,
59+
//! foo: i32,
6060
//! bar: f32,
6161
//! baz: Kind,
6262
//! }
@@ -73,7 +73,7 @@
7373
//! # use std::default::Default;
7474
//! # #[derive(Default)]
7575
//! # struct SomeOptions {
76-
//! # foo: int,
76+
//! # foo: i32,
7777
//! # bar: f32,
7878
//! # }
7979
//! fn main() {
@@ -93,7 +93,7 @@
9393
/// ```
9494
/// #[derive(Default)]
9595
/// struct SomeOptions {
96-
/// foo: int,
96+
/// foo: i32,
9797
/// bar: f32,
9898
/// }
9999
/// ```
@@ -113,7 +113,7 @@ pub trait Default {
113113
///
114114
/// let i: i8 = Default::default();
115115
/// let (x, y): (Option<String>, f64) = Default::default();
116-
/// let (a, b, (c, d)): (int, uint, (bool, bool)) = Default::default();
116+
/// let (a, b, (c, d)): (i32, u32, (bool, bool)) = Default::default();
117117
/// ```
118118
///
119119
/// Making your own:
@@ -150,13 +150,13 @@ default_impl! { (), () }
150150
default_impl! { bool, false }
151151
default_impl! { char, '\x00' }
152152

153-
default_impl! { uint, 0 }
153+
default_impl! { usize, 0 }
154154
default_impl! { u8, 0 }
155155
default_impl! { u16, 0 }
156156
default_impl! { u32, 0 }
157157
default_impl! { u64, 0 }
158158

159-
default_impl! { int, 0 }
159+
default_impl! { isize, 0 }
160160
default_impl! { i8, 0 }
161161
default_impl! { i16, 0 }
162162
default_impl! { i32, 0 }

0 commit comments

Comments
 (0)