Replace match on option with if

This commit is contained in:
ivan770 2021-03-27 11:17:17 +02:00
parent c7cd0aff4a
commit 0a5badbcba
No known key found for this signature in database
GPG key ID: D8C4BD5AE4D9CC4D

View file

@ -40,9 +40,10 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
macro_call.syntax().text_range()
};
let macro_end = match macro_call.semicolon_token() {
Some(_) => macro_text_range.end() - TextSize::of(';'),
None => macro_text_range.end(),
let macro_end = if macro_call.semicolon_token().is_some() {
macro_text_range.end() - TextSize::of(';')
} else {
macro_text_range.end()
};
acc.add(