include decode bencoded strings

This commit is contained in:
hendrik 2024-10-03 00:00:12 +02:00
parent d5a7ea5890
commit 0b47f50917
2 changed files with 6 additions and 6 deletions

View File

@ -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.

View File

@ -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])
}
}