replace manual Hash impls with #[deriving(Hash)]
This commit is contained in:
@@ -18,13 +18,12 @@ use str::OwnedStr;
|
||||
use container::Container;
|
||||
use cast;
|
||||
use fmt;
|
||||
use hash::{Hash, sip};
|
||||
use iter::Iterator;
|
||||
use vec::{ImmutableVector, MutableVector, Vector};
|
||||
use option::{Option, Some, None};
|
||||
|
||||
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
|
||||
#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq)]
|
||||
#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq, Hash)]
|
||||
pub struct Ascii { priv chr: u8 }
|
||||
|
||||
impl Ascii {
|
||||
@@ -306,13 +305,6 @@ impl IntoStr for ~[Ascii] {
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for Ascii {
|
||||
#[inline]
|
||||
fn hash(&self, s: &mut sip::SipState) {
|
||||
self.to_byte().hash(s)
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait to convert to an owned byte array by consuming self
|
||||
pub trait IntoBytes {
|
||||
/// Converts to an owned byte array by consuming self
|
||||
|
||||
Reference in New Issue
Block a user