Update rust toolchain to 1.45.0

This commit is contained in:
Alexander Krotov
2020-07-16 22:41:38 +03:00
committed by link2xt
parent 933b14eedf
commit 1c73021d77
6 changed files with 11 additions and 15 deletions

View File

@@ -6,10 +6,9 @@
// this escapes a bit more than actually needed by delta (eg. also lines as "-- footer"),
// but for non-delta-compatibility, that seems to be better.
// (to be only compatible with delta, only "[\r\n|\n]-- {0,2}[\r\n|\n]" needs to be replaced)
#[allow(clippy::indexing_slicing)]
pub fn escape_message_footer_marks(text: &str) -> String {
if text.starts_with("--") {
"-\u{200B}-".to_string() + &text[2..].replace("\n--", "\n-\u{200B}-")
if let Some(text) = text.strip_prefix("--") {
"-\u{200B}-".to_string() + &text.replace("\n--", "\n-\u{200B}-")
} else {
text.replace("\n--", "\n-\u{200B}-")
}