include decode bencoded strings
This commit is contained in:
parent
d5a7ea5890
commit
0b47f50917
@ -2,7 +2,7 @@
|
||||
#
|
||||
# These can be VERY verbose, so we suggest turning them off
|
||||
# unless you really need them.
|
||||
debug: false
|
||||
debug: true
|
||||
|
||||
# Use this to change the Rust version used to run your code
|
||||
# on Codecrafters.
|
||||
|
||||
10
src/main.rs
10
src/main.rs
@ -26,13 +26,13 @@ fn main() {
|
||||
|
||||
if command == "decode" {
|
||||
// You can use print statements as follows for debugging, they'll be visible when running tests.
|
||||
println!("Logs from your program will appear here!");
|
||||
eprintln!("Logs from your program will appear here!");
|
||||
|
||||
// Uncomment this block to pass the first stage
|
||||
// let encoded_value = &args[2];
|
||||
// let decoded_value = decode_bencoded_value(encoded_value);
|
||||
// println!("{}", decoded_value.to_string());
|
||||
let encoded_value = &args[2];
|
||||
let decoded_value = decode_bencoded_value(encoded_value);
|
||||
println!("{}", decoded_value.to_string());
|
||||
} else {
|
||||
println!("unknown command: {}", args[1])
|
||||
eprintln!("unknown command: {}", args[1])
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user