Skip to content

Commit

Permalink
rustdoc: Rename typedef to type alias in jsondoclint
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Aug 23, 2023
1 parent 4d9ac5d commit d4ab99d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/tools/jsondoclint/src/item_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) enum Kind {
Enum,
Variant,
Function,
Typedef,
TypeAlias,
OpaqueTy,
Constant,
Trait,
Expand Down Expand Up @@ -45,7 +45,7 @@ impl Kind {
Trait => true,
TraitAlias => true,
Impl => true,
Typedef => true,
TypeAlias => true,
Constant => true,
Static => true,
Macro => true,
Expand Down Expand Up @@ -98,7 +98,7 @@ impl Kind {
Kind::Union => false,
Kind::Enum => false,
Kind::Variant => false,
Kind::Typedef => false,
Kind::TypeAlias => false,
Kind::OpaqueTy => false,
Kind::Constant => false,
Kind::Trait => false,
Expand Down Expand Up @@ -131,7 +131,7 @@ impl Kind {
matches!(self, Kind::Trait | Kind::TraitAlias)
}
pub fn is_type(self) -> bool {
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::Typedef)
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::TypeAlias)
}

pub fn from_item(i: &Item) -> Self {
Expand All @@ -148,7 +148,7 @@ impl Kind {
ItemEnum::Trait(_) => Trait,
ItemEnum::TraitAlias(_) => TraitAlias,
ItemEnum::Impl(_) => Impl,
ItemEnum::TypeAlias(_) => Typedef,
ItemEnum::TypeAlias(_) => TypeAlias,
ItemEnum::OpaqueTy(_) => OpaqueTy,
ItemEnum::Constant(_) => Constant,
ItemEnum::Static(_) => Static,
Expand Down Expand Up @@ -186,7 +186,7 @@ impl Kind {
ItemKind::StructField => StructField,
ItemKind::Trait => Trait,
ItemKind::TraitAlias => TraitAlias,
ItemKind::TypeAlias => Typedef,
ItemKind::TypeAlias => TypeAlias,
ItemKind::Union => Union,
ItemKind::Variant => Variant,
}
Expand Down
8 changes: 4 additions & 4 deletions src/tools/jsondoclint/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct Validator<'a> {

enum PathKind {
Trait,
/// Structs, Enums, Unions and Typedefs.
/// Structs, Enums, Unions and TypeAliases.
///
/// This doesn't include trait's because traits are not types.
Type,
Expand Down Expand Up @@ -99,7 +99,7 @@ impl<'a> Validator<'a> {
ItemEnum::Trait(x) => self.check_trait(x, id),
ItemEnum::TraitAlias(x) => self.check_trait_alias(x),
ItemEnum::Impl(x) => self.check_impl(x, id),
ItemEnum::TypeAlias(x) => self.check_typedef(x),
ItemEnum::TypeAlias(x) => self.check_type_alias(x),
ItemEnum::OpaqueTy(x) => self.check_opaque_ty(x),
ItemEnum::Constant(x) => self.check_constant(x),
ItemEnum::Static(x) => self.check_static(x),
Expand Down Expand Up @@ -221,7 +221,7 @@ impl<'a> Validator<'a> {
}
}

fn check_typedef(&mut self, x: &'a TypeAlias) {
fn check_type_alias(&mut self, x: &'a TypeAlias) {
self.check_generics(&x.generics);
self.check_type(&x.type_);
}
Expand Down Expand Up @@ -450,7 +450,7 @@ impl<'a> Validator<'a> {
}

fn add_type_id(&mut self, id: &'a Id) {
self.add_id_checked(id, Kind::is_type, "Type (Struct, Enum, Union or Typedef)");
self.add_id_checked(id, Kind::is_type, "Type (Struct, Enum, Union or TypeAlias)");
}

/// Add an Id that appeared in a trait
Expand Down

0 comments on commit d4ab99d

Please sign in to comment.