cargo fmt
This commit is contained in:
@@ -173,11 +173,7 @@ fn decode_coordinate(data: &[u8], pos: usize) -> Result<(i16, u8, usize), Error>
|
|||||||
Ok((value, flags, 2))
|
Ok((value, flags, 2))
|
||||||
} else {
|
} else {
|
||||||
// 7-bit encoding (1 byte)
|
// 7-bit encoding (1 byte)
|
||||||
let value = if b > 0x3F {
|
let value = if b > 0x3F { b as i16 - 0x80 } else { b as i16 };
|
||||||
b as i16 - 0x80
|
|
||||||
} else {
|
|
||||||
b as i16
|
|
||||||
};
|
|
||||||
Ok((value, 0, 1))
|
Ok((value, 0, 1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ fn main() -> Result<()> {
|
|||||||
let data = fs::read(&args.input)
|
let data = fs::read(&args.input)
|
||||||
.with_context(|| format!("failed to read {}", args.input.display()))?;
|
.with_context(|| format!("failed to read {}", args.input.display()))?;
|
||||||
|
|
||||||
let png = rustitch::thumbnail(&data, args.size)
|
let png =
|
||||||
.with_context(|| "failed to generate thumbnail")?;
|
rustitch::thumbnail(&data, args.size).with_context(|| "failed to generate thumbnail")?;
|
||||||
|
|
||||||
fs::write(&args.output, &png)
|
fs::write(&args.output, &png)
|
||||||
.with_context(|| format!("failed to write {}", args.output.display()))?;
|
.with_context(|| format!("failed to write {}", args.output.display()))?;
|
||||||
|
|||||||
Reference in New Issue
Block a user