Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Dec 1, 2023
1 parent a840d0d commit 3ee21bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/candid/src/pretty/candid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ pub mod value {
Opt(v) => write!(f, "opt {v:?}"),
Blob(b) => {
write!(f, "blob \"")?;
let is_ascii = b.iter().all(|c| (0x20..=0x7e).contains(&c));
let is_ascii = b.iter().all(|c| (0x20u8..=0x7eu8).contains(c));
if is_ascii {
for v in b.iter() {
write!(f, "{}", pp_char(*v))?;
Expand Down Expand Up @@ -441,7 +441,7 @@ pub mod value {
}

pub fn pp_char(v: u8) -> String {
let is_ascii = (0x20..=0x7e).contains(&v);
let is_ascii = (0x20u8..=0x7eu8).contains(v);
if is_ascii && v != 0x22 && v != 0x27 && v != 0x60 && v != 0x5c {
std::char::from_u32(v as u32).unwrap().to_string()
} else {
Expand Down

0 comments on commit 3ee21bb

Please sign in to comment.