mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-21 02:17:02 +02:00
Break: extract the re-imports to prelude
This commit is contained in:
1 parent
e1d9c27bda
commit
de6deb3a06
5 files changed
+11
-11
No files matched your search
@@ -14,8 +14,7 @@ World of Tanks Blitz replay parser in Rust.
|
||||
use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::Replay;
|
||||
use wotbreplay_parser::models::TeamNumber;
|
||||
use wotbreplay_parser::prelude::*;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let battle_results = Replay::open(File::open("tests/replays/battle_results.wotbreplay")?)?
|
||||
|
||||
+2
-5
@@ -11,14 +11,11 @@
|
||||
)]
|
||||
|
||||
mod error;
|
||||
pub mod models;
|
||||
mod models;
|
||||
pub mod prelude;
|
||||
mod replay;
|
||||
mod result;
|
||||
|
||||
pub use crate::error::Error;
|
||||
pub use crate::replay::Replay;
|
||||
pub use crate::result::Result;
|
||||
|
||||
#[cfg(doctest)]
|
||||
mod test_readme {
|
||||
macro_rules! external_doc_test {
|
||||
|
||||
@@ -4,8 +4,9 @@ use prost::Message;
|
||||
use serde::Deserialize;
|
||||
use serde_bytes::ByteBuf;
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::models::BattleResults;
|
||||
use crate::{Error, Result};
|
||||
use crate::result::Result;
|
||||
|
||||
/// Represents un-pickled `battle_results.dat`.
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
pub use crate::error::Error;
|
||||
pub use crate::models::*;
|
||||
pub use crate::replay::Replay;
|
||||
pub use crate::result::Result;
|
||||
@@ -1,8 +1,7 @@
|
||||
use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::models::TeamNumber;
|
||||
use wotbreplay_parser::Replay;
|
||||
use wotbreplay_parser::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn player_results_ok() -> Result<()> {
|
||||
@@ -114,7 +113,7 @@ fn author_results_ok() -> Result<()> {
|
||||
assert_eq!(battle_results.author.credits_earned, 53623);
|
||||
assert_eq!(battle_results.author.combat_xp, 2370);
|
||||
assert_eq!(battle_results.author.damage_dealt, 1738);
|
||||
assert_eq!(battle_results.author.account_id, 594778041);
|
||||
assert_eq!(battle_results.author.account_id, AccountId(594778041));
|
||||
assert_eq!(battle_results.free_xp, 116);
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user