// The `top` parameter is used when generating the item declaration to ensure it doesn't have a
// left padding. For example:
//
// #[foo] <----- "top" attribute
// struct Foo {
//     #[bar] <---- not "top" attribute
//     bar: usize,
// }
The `top` parameter is used when generating the item declaration to ensure it doesn't have a
left padding. For example.
The ` top ` parameter is used when generating the item declaration to ensure it doesn ' t have a left padding . For example .
fn render_attributes(w: &mut Buffer, it: &clean::Item, top: bool) {
    let mut attrs = String::new();
    for attr in &it.attrs.other_attrs {
        if !ATTRIBUTE_WHITELIST.contains(&attr.name_or_empty()) {
            continue;
        }
        if let Some(s) = render_attribute(&attr.meta().unwrap()) {
            attrs.push_str(&format!("#[{}]\n", s));
        }
    }
    if attrs.len() > 0 {
        write!(w, "<span class=\"docblock attributes{}\">{}</span>",
               if top { " top-attr" } else { "" }, &attrs);
    }
}
fn render_attributes ( w : & mut Buffer , it : & clean :: Item , top : bool ) { let mut attrs = String :: new ( ) ; for attr in & it . attrs . other_attrs { if ! ATTRIBUTE_WHITELIST . contains ( & attr . name_or_empty ( ) ) { continue ; } if let Some ( s ) = render_attribute ( & attr . meta ( ) . unwrap ( ) ) { attrs . push_str ( & format ! ( " \n " s ) ) ; } } if attrs . len ( ) > 0 { write ! ( w " \" \" " if top { " " } else { " " } attrs ) ; } }
The `top` parameter is used when generating the item declaration to ensure it doesn't have a
left padding.
The ` top ` parameter is used when generating the item declaration to ensure it doesn ' t have a left padding .
w
&mut Buffer
it
&clean::Item
top
bool
[foo] <----- "top" attribute
struct Foo {
[bar] <---- not "top" attribute
bar: usize,
}
struct Foo { [ bar ] < ---- not " top " attribute bar : usize }