From e1a9461806a4d6dd2ad58be2d6148c0e8fdb2299 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 21 Mar 2020 22:43:48 +0800 Subject: Add identity expansion checking --- crates/ra_syntax/src/algo.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_syntax/src') 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 { builder.replace(from.text_range(), to.to_string()) } } + + pub fn is_empty(&self) -> bool { + self.replacements.is_empty() + } } /// Finds minimal the diff, which, applied to `from`, will result in `to`. -- cgit v1.2.3