From d29fe4803944648e2ffed8980399e63cd461e592 Mon Sep 17 00:00:00 2001 From: Alicja Date: Wed, 17 Jun 2020 12:32:15 +0200 Subject: [PATCH] Remove special case for decoding a single byte --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f46781c..64eda93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -710,7 +710,7 @@ checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "urbit-q" -version = "0.3.0" +version = "0.3.1" dependencies = [ "criterion", "naughty-strings", diff --git a/Cargo.toml b/Cargo.toml index 437c0aa..0c922b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "urbit-q" -version = "0.3.0" +version = "0.3.1" authors = ["k2l8m11n2"] edition = "2018" description = "Encode and decode data in Urbit's @q format" diff --git a/src/lib.rs b/src/lib.rs index 3d57da6..5625d00 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,11 +81,6 @@ pub fn encode(input: &[u8]) -> String { pub fn decode(input: &str) -> Option> { let mut bytes = Vec::from(input); bytes.retain(|x| *x != ('-' as u8) && *x != ('~' as u8) && *x != (' ' as u8)); - if bytes.len() == 3 { - bytes[0] = *consts::SUFFIXES_MAP.get(&bytes[..])?; - bytes.truncate(1); - return Some(bytes); - } match bytes.len() % 6 { 0 => { for i in (0..bytes.len()).step_by(6) {