Skip to content

Commit

Permalink
Update pixeldata/src/attribute.rs
Browse files Browse the repository at this point in the history
Trim the whitestpaces and null characters in 1 go

Co-authored-by: Eduardo Pinho <enet4mikeenet@gmail.com>
  • Loading branch information
dougyau and Enet4 authored Jan 16, 2024
1 parent 075f266 commit 87bfa08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pixeldata/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ pub fn photometric_interpretation<D: DataDictionary + Clone>(
.context(MissingRequiredSnafu { name })?
.string()
.context(CastValueSnafu { name })?
.trim()
.trim_matches(char::from(0))
.trim_matches(|c: char| c.is_whitespace() || c == '\0')
.into())
}

Expand Down

0 comments on commit 87bfa08

Please sign in to comment.