rust-sd/0001-Convert-str-to-bytes-t...

32 lines
914 B
Diff

From 4e9aa7ddf297c2328f360e92e7e3b2978613e0a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Sun, 16 Jun 2019 20:55:24 +0200
Subject: [PATCH] Convert str to bytes to call replacer.replace
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix #39
Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
---
src/input.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/input.rs b/src/input.rs
index c5fcfef..3d24100 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -178,7 +178,10 @@ mod tests {
flags.map(ToOwned::to_owned),
)
.unwrap();
- assert_eq!(std::str::from_utf8(&replacer.replace(src)), Ok(target));
+ assert_eq!(
+ std::str::from_utf8(&replacer.replace(src.as_bytes())),
+ Ok(target)
+ );
}
#[test]