Add ty::Visibility::is_public()

This commit is contained in:
inquisitivecrystal
2021-11-07 19:53:26 -08:00
parent 8b09ba6a5d
commit 9a987b0466
12 changed files with 23 additions and 24 deletions

View File

@@ -333,6 +333,10 @@ impl Visibility {
Visibility::Invisible => false,
}
}
pub fn is_public(self) -> bool {
matches!(self, Visibility::Public)
}
}
/// The crate variances map is computed during typeck and contains the