Skip to content

Commit

Permalink
chore: bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal committed Jun 28, 2024
1 parent 1d3dc50 commit 497be8d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
30 changes: 14 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ path = "src/main.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
itertools = "0.10.0"
num-traits = "0.2.14"
num-bigint = "0.3"
itertools = "0.13.0"
num-traits = "0.2.19"
num-bigint = "0.4.6"
hex = "0.4.3"

[dev-dependencies]
yaml-rust = "0.4.4"
base64 = "0.13.0"
syn = "1.0"
quote = "1.0"
yaml-rust = "0.4.5"
base64 = "0.22.1"
syn = "2.0.68"
quote = "1.0.36"
15 changes: 9 additions & 6 deletions tests/codec/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use yaml_rust::parser::MarkedEventReceiver;
use yaml_rust::parser::Parser;
use yaml_rust::scanner::{Marker, ScanError, TokenType};
use yaml_rust::Event;
use base64::Engine;

use bencodex::codec::types::{BencodexKey, BencodexValue};

Expand Down Expand Up @@ -73,9 +74,11 @@ impl MarkedEventReceiver for TestsuiteYamlLoader {
Err(_) => unreachable!(),
Ok(v) => BencodexValue::Number(BigInt::from_i64(v).unwrap()),
},
"binary" => {
BencodexValue::Binary(base64::decode(v.replace('\n', "")).unwrap())
}
"binary" => BencodexValue::Binary(
base64::engine::general_purpose::STANDARD
.decode(v.replace('\n', ""))
.unwrap(),
),
"null" => match v.as_ref() {
"~" | "null" => BencodexValue::Null,
_ => unreachable!(),
Expand Down Expand Up @@ -169,19 +172,19 @@ pub fn iter_spec() -> std::io::Result<Vec<Spec>> {
let mut path: PathBuf = file.path();
let encoded = match fs::read(path.to_owned()) {
Ok(v) => v,
Err(why) => panic!(why),
Err(why) => panic!("{}", why),
};

path.set_extension("yaml");
let content = match fs::read_to_string(path.to_owned()) {
Ok(s) => s,
Err(why) => panic!(why),
Err(why) => panic!("{}", why),
};

let bvalue: BencodexValue =
match TestsuiteYamlLoader::load_from_str(&content.to_string()) {
Ok(v) => v.first().unwrap().to_owned(),
Err(why) => panic!(why),
Err(why) => panic!("{}", why),
};

Spec {
Expand Down

0 comments on commit 497be8d

Please sign in to comment.