@@ -646,7 +646,9 @@ fn shortty(item: &clean::Item) -> ItemType {
646646/// static HTML tree.
647647// FIXME (#9639): The closure should deal with &[u8] instead of &str
648648// FIXME (#9639): This is too conservative, rejecting non-UTF-8 paths
649- fn clean_srcpath ( src_root : & Path , src : & [ u8 ] , f: |& str|) {
649+ fn clean_srcpath < F > ( src_root : & Path , src : & [ u8 ] , mut f : F ) where
650+ F : FnMut ( & str ) ,
651+ {
650652 let p = Path :: new ( src) ;
651653
652654 // make it relative, if possible
@@ -1051,7 +1053,9 @@ impl<'a> Cache {
10511053impl Context {
10521054 /// Recurse in the directory structure and change the "root path" to make
10531055 /// sure it always points to the top (relatively)
1054- fn recurse < T > ( & mut self , s : String , f: |& mut Context | -> T ) -> T {
1056+ fn recurse < T , F > ( & mut self , s : String , f : F ) -> T where
1057+ F : FnOnce ( & mut Context ) -> T ,
1058+ {
10551059 if s. len ( ) == 0 {
10561060 panic ! ( "Unexpected empty destination: {}" , self . current) ;
10571061 }
@@ -1131,8 +1135,9 @@ impl Context {
11311135 /// all sub-items which need to be rendered.
11321136 ///
11331137 /// The rendering driver uses this closure to queue up more work.
1134- fn item ( & mut self , item : clean:: Item ,
1135- f : |& mut Context , clean:: Item |) -> io:: IoResult < ( ) > {
1138+ fn item < F > ( & mut self , item : clean:: Item , mut f : F ) -> io:: IoResult < ( ) > where
1139+ F : FnMut ( & mut Context , clean:: Item ) ,
1140+ {
11361141 fn render ( w : io:: File , cx : & Context , it : & clean:: Item ,
11371142 pushname : bool ) -> io:: IoResult < ( ) > {
11381143 info ! ( "Rendering an item to {}" , w. path( ) . display( ) ) ;
0 commit comments