File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -333,11 +333,11 @@ pub enum InlineAttr {
333333pub fn find_inline_attr ( diagnostic : Option < & Handler > , attrs : & [ Attribute ] ) -> InlineAttr {
334334 attrs. iter ( ) . fold ( InlineAttr :: None , |ia, attr| {
335335 match attr. node . value . node {
336- MetaItemKind :: Word ( ref n) if * n == "inline" => {
336+ MetaItemKind :: Word ( ref n) if n == "inline" => {
337337 mark_used ( attr) ;
338338 InlineAttr :: Hint
339339 }
340- MetaItemKind :: List ( ref n, ref items) if * n == "inline" => {
340+ MetaItemKind :: List ( ref n, ref items) if n == "inline" => {
341341 mark_used ( attr) ;
342342 if items. len ( ) != 1 {
343343 diagnostic. map ( |d|{ d. span_err ( attr. span , "expected one argument" ) ; } ) ;
@@ -711,7 +711,7 @@ pub fn require_unique_names(diagnostic: &Handler, metas: &[P<MetaItem>]) {
711711pub fn find_repr_attrs ( diagnostic : & Handler , attr : & Attribute ) -> Vec < ReprAttr > {
712712 let mut acc = Vec :: new ( ) ;
713713 match attr. node . value . node {
714- ast:: MetaItemKind :: List ( ref s, ref items) if * s == "repr" => {
714+ ast:: MetaItemKind :: List ( ref s, ref items) if s == "repr" => {
715715 mark_used ( attr) ;
716716 for item in items {
717717 match item. node {
Original file line number Diff line number Diff line change @@ -566,6 +566,28 @@ impl<'a> PartialEq<InternedString> for &'a str {
566566 }
567567}
568568
569+ impl PartialEq < str > for InternedString {
570+ #[ inline( always) ]
571+ fn eq ( & self , other : & str ) -> bool {
572+ PartialEq :: eq ( & self . string [ ..] , other)
573+ }
574+ #[ inline( always) ]
575+ fn ne ( & self , other : & str ) -> bool {
576+ PartialEq :: ne ( & self . string [ ..] , other)
577+ }
578+ }
579+
580+ impl PartialEq < InternedString > for str {
581+ #[ inline( always) ]
582+ fn eq ( & self , other : & InternedString ) -> bool {
583+ PartialEq :: eq ( self , & other. string [ ..] )
584+ }
585+ #[ inline( always) ]
586+ fn ne ( & self , other : & InternedString ) -> bool {
587+ PartialEq :: ne ( self , & other. string [ ..] )
588+ }
589+ }
590+
569591impl Decodable for InternedString {
570592 fn decode < D : Decoder > ( d : & mut D ) -> Result < InternedString , D :: Error > {
571593 Ok ( intern ( d. read_str ( ) ?. as_ref ( ) ) . as_str ( ) )
You can’t perform that action at this time.
0 commit comments