We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8944ca0 commit be1a4eeCopy full SHA for be1a4ee
src/descriptor/checksum.rs
@@ -43,10 +43,9 @@ pub fn desc_checksum(desc: &str) -> Result<String, Error> {
43
let mut clscount = 0;
44
45
for ch in desc.chars() {
46
- let pos = INPUT_CHARSET.find(ch).ok_or(Error::BadDescriptor(format!(
47
- "Invalid character in checksum: '{}'",
48
- ch
49
- )))? as u64;
+ let pos = INPUT_CHARSET.find(ch).ok_or_else(|| {
+ Error::BadDescriptor(format!("Invalid character in checksum: '{}'", ch))
+ })? as u64;
50
c = poly_mod(c, pos & 31);
51
cls = cls * 3 + (pos >> 5);
52
clscount += 1;
0 commit comments