Skip to content

Commit 17aa5f6

Browse files
committed
Extract some expr to variable
1 parent 70dbff2 commit 17aa5f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/ide-assists/src/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ pub(crate) fn indent_string(mut s: &str, indent_level: IndentLevel) -> Cow<'_, s
269269
buf.push_str(line);
270270
buf.push('\n');
271271

272-
if !rest.split_once('\n').map_or(rest, |s| s.0).is_empty() {
272+
let rest_line = rest.split_once('\n').map_or(rest, |s| s.0);
273+
if !rest_line.is_empty() {
273274
buf.push_str(&indent);
274275
}
275276

0 commit comments

Comments
 (0)