tangled
alpha
login
or
join now
da157.id
/
porcelain
0
fork
atom
cli dollcode encoder and decoder
0
fork
atom
overview
issues
pulls
pipelines
fix panic on decode format from using String::as_ref
0xda157
3 months ago
ca1dff51
070e3d16
+4
-4
1 changed file
expand all
collapse all
unified
split
src
main.rs
+4
-4
src/main.rs
···
1
1
-
use clap::{ArgGroup, Command, arg, command, crate_authors};
1
1
+
use clap::{ArgGroup, Command, Id, arg, command, crate_authors};
2
2
use lib_porcelain::{dollcode_decode, dollcode_encode};
3
3
4
4
fn main() {
···
53
53
54
54
let res = dollcode_decode(dollcode).expect("dollcodes may only contain '▖', '▘', or '▌'");
55
55
56
56
-
match dmatches.get_one("format").map(String::as_ref) {
57
57
-
Some("decimial") => print!("{}", res),
58
58
-
Some("hex") => print!("{:X}", res),
56
56
+
match dmatches.get_one("format").map(Id::as_ref) {
57
57
+
Some("decimial") => println!("{}", res),
58
58
+
Some("hex") => println!("{:X}", res),
59
59
None => println!("decimial: {}, hexadecimal: {:X}", res, res),
60
60
Some(_) => unreachable!(),
61
61
}