Merge crate and restricted visibilities
This commit is contained in:
parent
8cece636b2
commit
7b987e34c0
8 changed files with 12 additions and 32 deletions
|
@ -403,10 +403,9 @@ impl<'a> State<'a> {
|
|||
pub(crate) fn print_visibility(&mut self, vis: &ast::Visibility) {
|
||||
match vis.kind {
|
||||
ast::VisibilityKind::Public => self.word_nbsp("pub"),
|
||||
ast::VisibilityKind::Crate => self.word_nbsp("pub(crate)"),
|
||||
ast::VisibilityKind::Restricted { ref path, .. } => {
|
||||
let path = Self::to_string(|s| s.print_path(path, false, 0));
|
||||
if path == "self" || path == "super" {
|
||||
if path == "crate" || path == "self" || path == "super" {
|
||||
self.word_nbsp(format!("pub({})", path))
|
||||
} else {
|
||||
self.word_nbsp(format!("pub(in {})", path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue