diff options
| author | Lzu Tao <taolzu@gmail.com> | 2019-12-15 06:07:46 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2019-12-15 13:55:10 +0000 |
| commit | 7bf55f4aa536ce8fe12fabe640ea4eb5c5a7a572 (patch) | |
| tree | 2d087fa31d1da662ad683fd28894ac6217bbe144 /src/libcore/num | |
| parent | a605441e049f0b6d5f7715b94b8ac4662fd7fcf6 (diff) | |
| download | rust-7bf55f4aa536ce8fe12fabe640ea4eb5c5a7a572.tar.gz rust-7bf55f4aa536ce8fe12fabe640ea4eb5c5a7a572.zip | |
use Self alias in place of macros
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 33715418ffd..d091a8d86ea 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -67,7 +67,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s )] #[inline] pub const unsafe fn new_unchecked(n: $Int) -> Self { - $Ty(n) + Self(n) } /// Creates a non-zero if the given value is not zero. @@ -76,7 +76,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s pub fn new(n: $Int) -> Option<Self> { if n != 0 { // SAFETY: we just checked that there's no `0` - Some(unsafe { $Ty(n) }) + Some(unsafe { Self(n) }) } else { None } |
