diff options
| author | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-10-10 10:50:25 +0900 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-10-15 23:59:08 +0900 |
| commit | 6380f885278e33ff058e01555538ced58c44dacf (patch) | |
| tree | b2929ed708ac01b70ec685de7f607aa02df2b7cb /src/string.rs | |
| parent | 751bcf5fa08ee5c5ba156e43c7f8327f7968b02f (diff) | |
Cleanup
Diffstat (limited to 'src/string.rs')
| -rw-r--r-- | src/string.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.rs b/src/string.rs index ca063123e39..b70f9f0f12b 100644 --- a/src/string.rs +++ b/src/string.rs @@ -242,9 +242,9 @@ fn break_string(max_chars: usize, trim_end: bool, line_end: &str, input: &[&str] for (i, grapheme) in input[0..=index].iter().enumerate() { if is_line_feed(grapheme) { if i <= index_minus_ws { - let mut line = input[0..i].join(""); + let mut line = &input[0..i].join("")[..]; if trim_end { - line = line.trim_right().to_string(); + line = line.trim_right(); } return SnippetState::EndWithLineFeed(format!("{}\n", line), i + 1); } |
