mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove unused code from a bunch of crates
This commit is contained in:
parent
8b6ed3d182
commit
e64de8d90a
8 changed files with 6 additions and 74 deletions
|
@ -18,8 +18,6 @@ pub trait Int:
|
|||
{
|
||||
fn zero() -> Self;
|
||||
fn one() -> Self;
|
||||
fn max_value() -> Self;
|
||||
fn from_usize(n: usize) -> Option<Self>;
|
||||
fn to_usize(self) -> usize;
|
||||
}
|
||||
impl Int for isize {
|
||||
|
@ -32,14 +30,6 @@ impl Int for isize {
|
|||
1
|
||||
}
|
||||
#[inline]
|
||||
fn max_value() -> isize {
|
||||
::std::isize::MAX
|
||||
}
|
||||
#[inline]
|
||||
fn from_usize(n: usize) -> Option<isize> {
|
||||
num_traits::NumCast::from(n)
|
||||
}
|
||||
#[inline]
|
||||
fn to_usize(self) -> usize {
|
||||
num_traits::NumCast::from(self).unwrap()
|
||||
}
|
||||
|
@ -54,14 +44,6 @@ impl Int for usize {
|
|||
1
|
||||
}
|
||||
#[inline]
|
||||
fn max_value() -> usize {
|
||||
::std::usize::MAX
|
||||
}
|
||||
#[inline]
|
||||
fn from_usize(n: usize) -> Option<usize> {
|
||||
Some(n)
|
||||
}
|
||||
#[inline]
|
||||
fn to_usize(self) -> usize {
|
||||
self
|
||||
}
|
||||
|
@ -134,10 +116,6 @@ macro_rules! int_range_index {
|
|||
#[inline]
|
||||
fn one() -> $Self_ { $Self_($crate::Int::one()) }
|
||||
#[inline]
|
||||
fn max_value() -> $Self_ { $Self_($crate::Int::max_value()) }
|
||||
#[inline]
|
||||
fn from_usize(n: usize) -> Option<$Self_> { $crate::Int::from_usize(n).map($Self_) }
|
||||
#[inline]
|
||||
fn to_usize(self) -> usize { self.to_usize() }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue