move to EncodingRef

This commit is contained in:
Henry Schimke
2022-10-16 13:33:21 -05:00
parent 5a1ae8cd90
commit 76a91111e9
5 changed files with 10 additions and 10 deletions

View File

@@ -23,7 +23,7 @@
// import java.nio.charset.StandardCharsets;
// import java.util.Random;
use encoding::Encoding;
use encoding::{Encoding, EncodingRef};
use rand::Rng;
use std::collections::HashMap;
@@ -102,7 +102,7 @@ fn test_utf16_le() {
);
}
fn do_test(bytes: &Vec<u8>, charset: &dyn Encoding, encoding: &str) {
fn do_test(bytes: &Vec<u8>, charset: EncodingRef, encoding: &str) {
let guessedCharset = StringUtils::guessCharset(bytes, &HashMap::new());
let guessedEncoding = StringUtils::guessEncoding(bytes, &HashMap::new());
assert_eq!(charset.name(), guessedCharset.name());