@@ -646,7 +646,9 @@ fn shortty(item: &clean::Item) -> ItemType {
646
646
/// static HTML tree.
647
647
// FIXME (#9639): The closure should deal with &[u8] instead of &str
648
648
// 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
+ {
650
652
let p = Path :: new ( src) ;
651
653
652
654
// make it relative, if possible
@@ -1051,7 +1053,9 @@ impl<'a> Cache {
1051
1053
impl Context {
1052
1054
/// Recurse in the directory structure and change the "root path" to make
1053
1055
/// 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
+ {
1055
1059
if s. len ( ) == 0 {
1056
1060
panic ! ( "Unexpected empty destination: {}" , self . current) ;
1057
1061
}
@@ -1131,8 +1135,9 @@ impl Context {
1131
1135
/// all sub-items which need to be rendered.
1132
1136
///
1133
1137
/// 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
+ {
1136
1141
fn render ( w : io:: File , cx : & Context , it : & clean:: Item ,
1137
1142
pushname : bool ) -> io:: IoResult < ( ) > {
1138
1143
info ! ( "Rendering an item to {}" , w. path( ) . display( ) ) ;
0 commit comments