Skip to content
Snippets Groups Projects
Commit 5a9bdd36 authored by Matthew Hall's avatar Matthew Hall
Browse files

Update to a new version of base64

Fixes #41
parent 4fc60693
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......@@ -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" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment