We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3a349b + 381ace5 commit 6131cf3Copy full SHA for 6131cf3
crates/ra_syntax/src/ast/edit.rs
@@ -249,6 +249,16 @@ impl ast::PathSegment {
249
}
250
251
252
+impl ast::UseItem {
253
+ #[must_use]
254
+ pub fn with_use_tree(&self, use_tree: ast::UseTree) -> ast::UseItem {
255
+ if let Some(old) = self.use_tree() {
256
+ return replace_descendants(self, iter::once((old, use_tree)));
257
+ }
258
+ self.clone()
259
260
+}
261
+
262
#[must_use]
263
pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N {
264
N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap()
0 commit comments