From 5a9bdd366976a9d809872622461389375470563f Mon Sep 17 00:00:00 2001
From: Matthew Hall <matthew@quickbeam.me.uk>
Date: Mon, 11 Jun 2018 19:18:48 +0100
Subject: [PATCH] Update to a new version of base64

Fixes #41
---
 Cargo.toml | 2 +-
 src/lib.rs | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 3b38b25..d0a6c57 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,6 @@ name = "example"
 path = "examples/main.rs"
 
 [dependencies]
-base64 = "0.1.1"
+base64 = "0.5.2"
 xml-rs = "0.3.0"
 flate2 = "1.0.1"
diff --git a/src/lib.rs b/src/lib.rs
index 2f4de74..7f1af7e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,7 +11,6 @@ use std::fmt;
 use xml::reader::{EventReader, Error as XmlError};
 use xml::reader::XmlEvent;
 use xml::attribute::OwnedAttribute;
-use base64::{u8de as decode_base64, Base64Error};
 use flate2::read::{ZlibDecoder, GzDecoder};
 
 #[derive(Debug, Copy, Clone)]
@@ -114,7 +113,7 @@ pub enum TiledError {
     /// An error occured when decompressing using the
     /// [flate2](https://github.com/alexcrichton/flate2-rs) crate.
     DecompressingError(Error),
-    Base64DecodingError(Base64Error),
+    Base64DecodingError(base64::DecodeError),
     XmlDecodingError(XmlError),
     PrematureEnd(String),
     Other(String)
@@ -829,7 +828,7 @@ fn parse_data<R: Read>(parser: &mut EventReader<R>, attrs: Vec<OwnedAttribute>,
 fn parse_base64<R: Read>(parser: &mut EventReader<R>) -> Result<Vec<u8>, TiledError> {
     loop {
         match try!(parser.next().map_err(TiledError::XmlDecodingError)) {
-            XmlEvent::Characters(s) => return decode_base64(s.trim().as_bytes())
+            XmlEvent::Characters(s) => return base64::decode(s.trim().as_bytes())
                                     .map_err(TiledError::Base64DecodingError),
             XmlEvent::EndElement {name, ..} => {
                 if name.local_name == "data" {
-- 
GitLab