X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_data_structures%2Fthin_vec.rs;h=2befc0aa50487bcffe722061c0dfe0cce226f5ca;hb=eb769ed6b09cb9fa007508caef808f5e50264cb0;hp=93a8b7f525fffff540afb00792b30ed6819fc9b7;hpb=59a31c8c676bdc9f50490d5798b1b4e884b7d7ae;p=rust.git diff --git a/src/librustc_data_structures/thin_vec.rs b/src/librustc_data_structures/thin_vec.rs index 93a8b7f525f..2befc0aa504 100644 --- a/src/librustc_data_structures/thin_vec.rs +++ b/src/librustc_data_structures/thin_vec.rs @@ -1,9 +1,9 @@ -use crate::stable_hasher::{StableHasher, HashStable}; +use crate::stable_hasher::{HashStable, StableHasher}; /// A vector type optimized for cases where this size is usually 0 (cf. `SmallVector`). /// The `Option>` wrapping allows us to represent a zero sized vector with `None`, /// which uses only a single (null) pointer. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct ThinVec(Option>>); impl ThinVec { @@ -14,11 +14,7 @@ pub fn new() -> Self { impl From> for ThinVec { fn from(vec: Vec) -> Self { - if vec.is_empty() { - ThinVec(None) - } else { - ThinVec(Some(Box::new(vec))) - } + if vec.is_empty() { ThinVec(None) } else { ThinVec(Some(Box::new(vec))) } } }