@@ -359,7 +359,6 @@ crate struct StylePath {
359359
360360thread_local ! ( crate static CURRENT_DEPTH : Cell <usize > = Cell :: new( 0 ) ) ;
361361
362- // FIXME: make this work
363362crate const INITIAL_IDS : [ & ' static str ; 15 ] = [
364363 "main" ,
365364 "search" ,
@@ -4101,7 +4100,7 @@ fn item_typedef(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::T
41014100}
41024101
41034102fn item_foreign_type ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
4104- w. write_str ( "<pre class=\" rust foreigntype\" >extern {" ) ;
4103+ w. write_str ( "<pre class=\" rust foreigntype\" >extern {\n " ) ;
41054104 render_attributes ( w, it, false ) ;
41064105 write ! (
41074106 w,
@@ -4264,8 +4263,8 @@ fn get_methods(
42644263fn small_url_encode ( s : String ) -> String {
42654264 let mut st = String :: new ( ) ;
42664265 let mut last_match = 0 ;
4267- for ( idx, c) in s. bytes ( ) . enumerate ( ) {
4268- let escaped = match c as char {
4266+ for ( idx, c) in s. char_indices ( ) {
4267+ let escaped = match c {
42694268 '<' => "%3C" ,
42704269 '>' => "%3E" ,
42714270 ' ' => "%20" ,
@@ -4283,6 +4282,8 @@ fn small_url_encode(s: String) -> String {
42834282
42844283 st += & s[ last_match..idx] ;
42854284 st += escaped;
4285+ // NOTE: we only expect single byte characters here - which is fine as long as we
4286+ // only match single byte characters
42864287 last_match = idx + 1 ;
42874288 }
42884289
@@ -4834,12 +4835,12 @@ fn item_proc_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, m: &clean
48344835 w. push_str ( "<pre class=\" rust derive\" >" ) ;
48354836 write ! ( w, "#[derive({})]" , name) ;
48364837 if !m. helpers . is_empty ( ) {
4837- w. push_str ( "\n {" ) ;
4838- w. push_str ( " // Attributes available to this derive:" ) ;
4838+ w. push_str ( "\n {\n " ) ;
4839+ w. push_str ( " // Attributes available to this derive:\n " ) ;
48394840 for attr in & m. helpers {
48404841 writeln ! ( w, " #[{}]" , attr) ;
48414842 }
4842- w. push_str ( "}" ) ;
4843+ w. push_str ( "}\n " ) ;
48434844 }
48444845 w. push_str ( "</pre>" ) ;
48454846 }
0 commit comments