Skip to content

Commit

Permalink
Use is_ascii_graphic
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Dec 21, 2023
1 parent b076fe6 commit 64bf548
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/src/types/block/output/feature/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn verify_keys_packable<const VERIFY: bool>(
) -> Result<(), Error> {
if VERIFY {
for key in map.keys() {
if !key.is_ascii() {
if !key.iter().all(|b| b.is_ascii_graphic()) {
return Err(Error::NonAsciiMetadataKey(key.to_vec()));
}
}
Expand All @@ -63,7 +63,7 @@ impl MetadataFeature {
let data = data.into();

for key in data.keys() {
if !key.is_ascii() {
if !key.iter().all(|b| b.is_ascii_graphic()) {
return Err(Error::NonAsciiMetadataKey(key.to_vec()));
}
}
Expand Down Expand Up @@ -93,7 +93,7 @@ impl TryFrom<BTreeMap<Vec<u8>, Vec<u8>>> for MetadataFeature {
BoxedSlicePrefix<u8, MetadataFeatureValueLength>,
>::new();
for (k, v) in data {
if !k.is_ascii() {
if !k.iter().all(|b| b.is_ascii_graphic()) {
return Err(Error::NonAsciiMetadataKey(k.to_vec()));
}
res.insert(
Expand Down

0 comments on commit 64bf548

Please sign in to comment.