From 02f60b988473e0e773fd519dc2838cb305df5e91 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 24 Feb 2021 17:43:32 +0100 Subject: [PATCH] Fix typo in normalize_to_lf function name It took me a bit to figure out why I couldn't find this function when searching for it in the repository. Turns out this time it wasn't me spelled it wrong. --- src/mime.rs | 2 +- src/worker/handlers.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mime.rs b/src/mime.rs index b497224..63d6115 100644 --- a/src/mime.rs +++ b/src/mime.rs @@ -44,6 +44,6 @@ impl ToString for MimeType { /// 'text' mime types require CRLF line ending according to /// RFC-2046, however the platform line terminator and what applications /// expect is LF. -pub fn normilize_to_lf(text: String) -> String { +pub fn normalize_to_lf(text: String) -> String { text.replace("\r\n", "\n").replace("\r", "\n") } diff --git a/src/worker/handlers.rs b/src/worker/handlers.rs index 347b626..bbdc308 100644 --- a/src/worker/handlers.rs +++ b/src/worker/handlers.rs @@ -51,7 +51,7 @@ macro_rules! handle_load { let mut contents = String::new(); let result = reader.read_to_string(&mut contents).map(|_| { if mime_type == MimeType::Utf8String { - mime::normilize_to_lf(contents) + mime::normalize_to_lf(contents) } else { contents }