Skip to content

Commit

Permalink
Remove ASCII check
Browse files Browse the repository at this point in the history
We are no longer dealing with strings so there's no possibility of
slicing in the middle of a codepoint.
  • Loading branch information
alajpie committed Jun 17, 2020
1 parent fa76832 commit 19b8999
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "urbit-q"
version = "0.2.3"
version = "0.2.4"
authors = ["k2l8m11n2"]
edition = "2018"
description = "Encode and decode data in Urbit's @q format"
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ pub fn encode(input: &[u8]) -> String {
/// decode("hello world"); // None
/// ```
pub fn decode(input: &str) -> Option<Vec<u8>> {
if !input.is_ascii() {
return None;
}
let mut input_bytes = Vec::from(input);
input_bytes.retain(|x| *x != ('-' as u8) && *x != (' ' as u8));
if input_bytes.len() == 3 {
Expand Down

0 comments on commit 19b8999

Please sign in to comment.