13
13
//! which are available for use externally when compiled as a library.
14
14
15
15
use std:: hashmap:: { HashSet , HashMap } ;
16
- use std:: util ;
16
+ use std:: mem :: replace ;
17
17
18
18
use metadata:: csearch;
19
19
use middle:: resolve;
@@ -679,7 +679,7 @@ impl<'a> Visitor<()> for PrivacyVisitor<'a> {
679
679
return ;
680
680
}
681
681
682
- let orig_curitem = util :: replace ( & mut self . curitem , item. id ) ;
682
+ let orig_curitem = replace ( & mut self . curitem , item. id ) ;
683
683
visit:: walk_item ( self , item, ( ) ) ;
684
684
self . curitem = orig_curitem;
685
685
}
@@ -861,7 +861,7 @@ impl Visitor<()> for SanePrivacyVisitor {
861
861
self . check_sane_privacy ( item) ;
862
862
}
863
863
864
- let orig_in_fn = util :: replace ( & mut self . in_fn , match item. node {
864
+ let orig_in_fn = replace ( & mut self . in_fn , match item. node {
865
865
ast:: ItemMod ( ..) => false , // modules turn privacy back on
866
866
_ => self . in_fn , // otherwise we inherit
867
867
} ) ;
@@ -872,7 +872,7 @@ impl Visitor<()> for SanePrivacyVisitor {
872
872
fn visit_fn ( & mut self , fk : & visit:: FnKind , fd : & ast:: FnDecl ,
873
873
b : & ast:: Block , s : Span , n : ast:: NodeId , _: ( ) ) {
874
874
// This catches both functions and methods
875
- let orig_in_fn = util :: replace ( & mut self . in_fn , true ) ;
875
+ let orig_in_fn = replace ( & mut self . in_fn , true ) ;
876
876
visit:: walk_fn ( self , fk, fd, b, s, n, ( ) ) ;
877
877
self . in_fn = orig_in_fn;
878
878
}
0 commit comments