From 492b35f629b6a8b1a65f74e210d3e12ee45c3abf Mon Sep 17 00:00:00 2001 From: Jordy Dickinson Date: Fri, 24 Jan 2014 12:29:00 -0500 Subject: [PATCH] Fix base64 due to from_utf8 and replace changes These two changes were made in rust's std lib: 1. `str::replace` was a method of str, now it's a function. 2. `from_utf8` now wraps its return value in Option. --- base64/base64.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base64/base64.rs b/base64/base64.rs index 80636baea..bac21d1de 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -82,9 +82,9 @@ fn main() { } fn decode(input: &mut Reader, ignore_garbage: bool) { - let mut to_decode = str::from_utf8_owned(input.read_to_end()); + let mut to_decode = str::from_utf8_owned(input.read_to_end()).unwrap(); - to_decode = to_decode.replace("\n", ""); + to_decode = str::replace(to_decode, "\n", ""); if ignore_garbage { let standard_chars =