aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-03-21 14:43:48 +0000
committerEdwin Cheng <[email protected]>2020-03-21 14:43:48 +0000
commite1a9461806a4d6dd2ad58be2d6148c0e8fdb2299 (patch)
tree4bc77ef5e85876a4c5a164da97ceb0bdde9bdbb7 /crates/ra_syntax/src
parent92b561b5c7da8303473792ba2bacb430614da2d1 (diff)
Add identity expansion checking
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/algo.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs
index 344cf0fbe..ffdbdc767 100644
--- a/crates/ra_syntax/src/algo.rs
+++ b/crates/ra_syntax/src/algo.rs
@@ -95,6 +95,10 @@ impl TreeDiff {
95 builder.replace(from.text_range(), to.to_string()) 95 builder.replace(from.text_range(), to.to_string())
96 } 96 }
97 } 97 }
98
99 pub fn is_empty(&self) -> bool {
100 self.replacements.is_empty()
101 }
98} 102}
99 103
100/// Finds minimal the diff, which, applied to `from`, will result in `to`. 104/// Finds minimal the diff, which, applied to `from`, will result in `to`.