Skip to content

Commit e271386

Browse files
committed
Remove Type::is_valid_identifier
1 parent 7b30d75 commit e271386

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/ir/ty.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,15 @@ impl Type {
261261
match self.kind {
262262
TypeKind::Named => {
263263
let name = self.name().expect("Unnamed named type?");
264-
!Self::is_valid_identifier(&name)
264+
!clang::is_valid_identifier(&name)
265265
}
266266
_ => false,
267267
}
268268
}
269269

270-
/// Checks whether the name looks like an identifier,
271-
/// i.e. is alphanumeric (including '_') and does not start with a digit.
272-
fn is_valid_identifier(name: &str) -> bool {
273-
clang::is_valid_identifier(name)
274-
}
275-
276270
/// Takes `name`, and returns a suitable identifier representation for it.
277271
fn sanitize_name<'a>(name: &'a str) -> Cow<'a, str> {
278-
if Self::is_valid_identifier(name) {
272+
if clang::is_valid_identifier(name) {
279273
return Cow::Borrowed(name)
280274
}
281275

@@ -1112,7 +1106,7 @@ impl Type {
11121106

11131107
if name.is_empty() {
11141108
let pretty_name = ty.spelling();
1115-
if Self::is_valid_identifier(&pretty_name) {
1109+
if clang::is_valid_identifier(&pretty_name) {
11161110
name = pretty_name;
11171111
}
11181112
}
@@ -1130,7 +1124,7 @@ impl Type {
11301124
// The pretty-printed name may contain typedefed name,
11311125
// but may also be "struct (anonymous at .h:1)"
11321126
let pretty_name = ty.spelling();
1133-
if Self::is_valid_identifier(&pretty_name) {
1127+
if clang::is_valid_identifier(&pretty_name) {
11341128
name = pretty_name;
11351129
}
11361130
}

0 commit comments

Comments
 (0)