Fix cargo clippy warnings
Signed-off-by: trivernis <trivernis@protonmail.com>pull/9/head
parent
4d5b3766d3
commit
85213d09a3
@ -1,29 +1,21 @@
|
|||||||
use std::collections::HashMap;
|
|
||||||
use std::convert::TryInto;
|
|
||||||
use crate::api::protocol::Protocol;
|
|
||||||
use crate::api::tests::get_test_versions;
|
|
||||||
use crate::models::protocol::{PacketDataType};
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub const VERSIONS_TO_SKIP: [&str; 3] = ["21w07a", "20w14a", "20w13b"];
|
use crate::api::protocol::Protocol;
|
||||||
|
use crate::api::tests::get_test_versions;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn simple_test() {
|
pub fn test_get_protocol() {
|
||||||
let versions = get_test_versions();
|
let versions = get_test_versions();
|
||||||
|
|
||||||
for x in versions {
|
for x in versions {
|
||||||
if VERSIONS_TO_SKIP.contains(&x.minecraft_version.as_str()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let arc = Arc::new(x);
|
let arc = Arc::new(x);
|
||||||
let protocol = Protocol::new(arc.clone());
|
let protocol = Protocol::new(arc.clone());
|
||||||
let protocol1 = protocol.get_protocol();
|
|
||||||
match protocol1 {
|
|
||||||
Ok(data) => {
|
|
||||||
|
|
||||||
}
|
if let Err(e) = protocol.get_protocol() {
|
||||||
Err(error) => {
|
panic!(
|
||||||
panic!("Minecraft Version {} could not be parsed into a Protocol object: {}", arc.minecraft_version, error);
|
"Minecraft Version {} could not be parsed into a Protocol object: {}",
|
||||||
}
|
arc.minecraft_version, e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue