Skip to content

Commit 5b5bf46

Browse files
apoelstrasanket1729
authored andcommitted
replace manual 'ch > 0x7f' checks with is_ascii
1 parent b1cb8e0 commit 5b5bf46

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/descriptor/tr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl<Pk: MiniscriptKey> fmt::Display for Tr<Pk> {
458458
// Helper function to parse string into miniscript tree form
459459
fn parse_tr_tree(s: &str) -> Result<Tree, Error> {
460460
for ch in s.bytes() {
461-
if ch > 0x7f {
461+
if !ch.is_ascii() {
462462
return Err(Error::Unprintable(ch));
463463
}
464464
}

src/expression.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a> Tree<'a> {
213213
// Filter out non-ASCII because we byte-index strings all over the
214214
// place and Rust gets very upset when you splinch a string.
215215
for ch in s.bytes() {
216-
if ch > 0x7f {
216+
if !ch.is_ascii() {
217217
return Err(Error::Unprintable(ch));
218218
}
219219
}

0 commit comments

Comments
 (0)