Fix typos in librustdoc

This commit is contained in:
DaniPopes 2023-04-10 21:02:29 +02:00
parent a73288371e
commit b410f3f7ae
No known key found for this signature in database
GPG key ID: 0F09640DDB7AC692
4 changed files with 7 additions and 6 deletions

View file

@ -2019,7 +2019,7 @@ impl Variant {
#[derive(Clone, Debug)]
pub(crate) struct Discriminant {
// In the case of cross crate re-exports, we don't have the nessesary information
// In the case of cross crate re-exports, we don't have the necessary information
// to reconstruct the expression of the discriminant, only the value.
pub(super) expr: Option<BodyId>,
pub(super) value: DefId,

View file

@ -230,7 +230,7 @@ pub(crate) struct RenderOptions {
pub(crate) extension_css: Option<PathBuf>,
/// A map of crate names to the URL to use instead of querying the crate's `html_root_url`.
pub(crate) extern_html_root_urls: BTreeMap<String, String>,
/// Whether to give precedence to `html_root_url` or `--exten-html-root-url`.
/// Whether to give precedence to `html_root_url` or `--extern-html-root-url`.
pub(crate) extern_html_root_takes_precedence: bool,
/// A map of the default settings (values are as for DOM storage API). Keys should lack the
/// `rustdoc-` prefix.

View file

@ -349,10 +349,10 @@ 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("\n");
let padding_amout =
let padding_amount =
if ending == Ending::Newline { indent + 4 } else { indent + "fn where ".len() };
for _ in 0..padding_amout {
for _ in 0..padding_amount {
br_with_padding.push_str(" ");
}
let where_preds = where_preds.to_string().replace('\n', &br_with_padding);

View file

@ -1796,10 +1796,11 @@ fn render_struct(
}
match ty {
None => {
let where_diplayed = g.map(|g| print_where_clause_and_check(w, g, cx)).unwrap_or(false);
let where_displayed =
g.map(|g| print_where_clause_and_check(w, g, cx)).unwrap_or(false);
// If there wasn't a `where` clause, we add a whitespace.
if !where_diplayed {
if !where_displayed {
w.write_str(" {");
} else {
w.write_str("{");