X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fhtml%2Fformat.rs;h=74cdf9b9b798550c8373ba40e3b0d49ec88e4568;hb=784665d4ce59c5239791f1f96fa2137e47ca1817;hp=33404a76835975da4e656f3f8bff6f5952116202;hpb=f3126500f25114ba4e0ac3e76694dd45a22de56d;p=rust.git diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 33404a76835..74cdf9b9b79 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -208,7 +208,7 @@ pub(crate) fn print<'a, 'tcx: 'a>( if f.alternate() { write!(f, ": {:#}", print_generic_bounds(bounds, cx))?; } else { - write!(f, ": {}", print_generic_bounds(bounds, cx))?; + write!(f, ": {}", print_generic_bounds(bounds, cx))?; } } @@ -216,7 +216,7 @@ pub(crate) fn print<'a, 'tcx: 'a>( if f.alternate() { write!(f, " = {:#}", ty.print(cx))?; } else { - write!(f, " = {}", ty.print(cx))?; + write!(f, " = {}", ty.print(cx))?; } } @@ -226,14 +226,14 @@ pub(crate) fn print<'a, 'tcx: 'a>( if f.alternate() { write!(f, "const {}: {:#}", self.name, ty.print(cx))?; } else { - write!(f, "const {}: {}", self.name, ty.print(cx))?; + write!(f, "const {}: {}", self.name, ty.print(cx))?; } if let Some(default) = default { if f.alternate() { write!(f, " = {:#}", default)?; } else { - write!(f, " = {}", default)?; + write!(f, " = {}", default)?; } } @@ -354,12 +354,12 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>( let mut br_with_padding = String::with_capacity(6 * indent + 28); br_with_padding.push_str("
"); for _ in 0..indent + 4 { - br_with_padding.push_str(" "); + br_with_padding.push_str(" "); } let where_preds = where_preds.to_string().replace("
", &br_with_padding); if ending == Ending::Newline { - let mut clause = " ".repeat(indent.saturating_sub(1)); + let mut clause = " ".repeat(indent.saturating_sub(1)); write!(clause, "where{where_preds},")?; clause } else { @@ -368,7 +368,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>( format!("
where{where_preds}") } else { let mut clause = br_with_padding; - clause.truncate(clause.len() - 4 * " ".len()); + clause.truncate(clause.len() - 4); write!(clause, "where{where_preds}")?; clause } @@ -1391,8 +1391,8 @@ fn inner_full_print( let declaration_len = header_len + args_plain.len() + arrow_plain.len(); let output = if declaration_len > 80 { - let full_pad = format!("
{}", " ".repeat(indent + 4)); - let close_pad = format!("
{}", " ".repeat(indent)); + let full_pad = format!("
{}", " ".repeat(indent + 4)); + let close_pad = format!("
{}", " ".repeat(indent)); format!( "({pad}{args}{close}){arrow}", pad = if self.inputs.values.is_empty() { "" } else { &full_pad }, @@ -1611,7 +1611,7 @@ pub(crate) fn print<'a, 'tcx: 'a>( if f.alternate() { write!(f, ": {:#}", print_generic_bounds(bounds, cx))?; } else { - write!(f, ": {}", print_generic_bounds(bounds, cx))?; + write!(f, ": {}", print_generic_bounds(bounds, cx))?; } } }