Skip to content

Commit d4ab99d

Browse files
committed
rustdoc: Rename typedef to type alias in jsondoclint
1 parent 4d9ac5d commit d4ab99d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Diff for: src/tools/jsondoclint/src/item_kind.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(crate) enum Kind {
1212
Enum,
1313
Variant,
1414
Function,
15-
Typedef,
15+
TypeAlias,
1616
OpaqueTy,
1717
Constant,
1818
Trait,
@@ -45,7 +45,7 @@ impl Kind {
4545
Trait => true,
4646
TraitAlias => true,
4747
Impl => true,
48-
Typedef => true,
48+
TypeAlias => true,
4949
Constant => true,
5050
Static => true,
5151
Macro => true,
@@ -98,7 +98,7 @@ impl Kind {
9898
Kind::Union => false,
9999
Kind::Enum => false,
100100
Kind::Variant => false,
101-
Kind::Typedef => false,
101+
Kind::TypeAlias => false,
102102
Kind::OpaqueTy => false,
103103
Kind::Constant => false,
104104
Kind::Trait => false,
@@ -131,7 +131,7 @@ impl Kind {
131131
matches!(self, Kind::Trait | Kind::TraitAlias)
132132
}
133133
pub fn is_type(self) -> bool {
134-
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::Typedef)
134+
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::TypeAlias)
135135
}
136136

137137
pub fn from_item(i: &Item) -> Self {
@@ -148,7 +148,7 @@ impl Kind {
148148
ItemEnum::Trait(_) => Trait,
149149
ItemEnum::TraitAlias(_) => TraitAlias,
150150
ItemEnum::Impl(_) => Impl,
151-
ItemEnum::TypeAlias(_) => Typedef,
151+
ItemEnum::TypeAlias(_) => TypeAlias,
152152
ItemEnum::OpaqueTy(_) => OpaqueTy,
153153
ItemEnum::Constant(_) => Constant,
154154
ItemEnum::Static(_) => Static,
@@ -186,7 +186,7 @@ impl Kind {
186186
ItemKind::StructField => StructField,
187187
ItemKind::Trait => Trait,
188188
ItemKind::TraitAlias => TraitAlias,
189-
ItemKind::TypeAlias => Typedef,
189+
ItemKind::TypeAlias => TypeAlias,
190190
ItemKind::Union => Union,
191191
ItemKind::Variant => Variant,
192192
}

Diff for: src/tools/jsondoclint/src/validator.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct Validator<'a> {
3737

3838
enum PathKind {
3939
Trait,
40-
/// Structs, Enums, Unions and Typedefs.
40+
/// Structs, Enums, Unions and TypeAliases.
4141
///
4242
/// This doesn't include trait's because traits are not types.
4343
Type,
@@ -99,7 +99,7 @@ impl<'a> Validator<'a> {
9999
ItemEnum::Trait(x) => self.check_trait(x, id),
100100
ItemEnum::TraitAlias(x) => self.check_trait_alias(x),
101101
ItemEnum::Impl(x) => self.check_impl(x, id),
102-
ItemEnum::TypeAlias(x) => self.check_typedef(x),
102+
ItemEnum::TypeAlias(x) => self.check_type_alias(x),
103103
ItemEnum::OpaqueTy(x) => self.check_opaque_ty(x),
104104
ItemEnum::Constant(x) => self.check_constant(x),
105105
ItemEnum::Static(x) => self.check_static(x),
@@ -221,7 +221,7 @@ impl<'a> Validator<'a> {
221221
}
222222
}
223223

224-
fn check_typedef(&mut self, x: &'a TypeAlias) {
224+
fn check_type_alias(&mut self, x: &'a TypeAlias) {
225225
self.check_generics(&x.generics);
226226
self.check_type(&x.type_);
227227
}
@@ -450,7 +450,7 @@ impl<'a> Validator<'a> {
450450
}
451451

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

456456
/// Add an Id that appeared in a trait

0 commit comments

Comments
 (0)