Skip to content

Commit bb0e103

Browse files
Merge pull request #22037 from Shourya742/2026-04-14-remove-set-visibility
Remove set visibility method
2 parents 77d1aa6 + 7581a1e commit bb0e103

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

crates/syntax/src/ast/edit_in_place.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -625,31 +625,6 @@ impl ast::IdentPat {
625625
}
626626
}
627627

628-
pub trait HasVisibilityEdit: ast::HasVisibility {
629-
fn set_visibility(&self, visibility: Option<ast::Visibility>) {
630-
if let Some(visibility) = visibility {
631-
match self.visibility() {
632-
Some(current_visibility) => {
633-
ted::replace(current_visibility.syntax(), visibility.syntax())
634-
}
635-
None => {
636-
let vis_before = self
637-
.syntax()
638-
.children_with_tokens()
639-
.find(|it| !matches!(it.kind(), WHITESPACE | COMMENT | ATTR))
640-
.unwrap_or_else(|| self.syntax().first_child_or_token().unwrap());
641-
642-
ted::insert(ted::Position::before(vis_before), visibility.syntax());
643-
}
644-
}
645-
} else if let Some(visibility) = self.visibility() {
646-
ted::remove(visibility.syntax());
647-
}
648-
}
649-
}
650-
651-
impl<T: ast::HasVisibility> HasVisibilityEdit for T {}
652-
653628
pub trait Indent: AstNode + Clone + Sized {
654629
fn indent_level(&self) -> IndentLevel {
655630
IndentLevel::from_node(self.syntax())

0 commit comments

Comments
 (0)