Bump gamelog to 0.3.0 and migrate to own library.
This commit is contained in:
@@ -14,7 +14,7 @@ impl fmt::Display for LogFileError {
|
||||
Self::CompatibilityCheck(ver) => write!(
|
||||
f,
|
||||
"GameLogs cannot be older than {}, but {} was found in logfile.",
|
||||
crate::gamelog::GAMELOG_MIN_VER.to_string(),
|
||||
crate::gamelog::MIN_VER.to_string(),
|
||||
ver.to_string()
|
||||
),
|
||||
Self::RonSpannedError(err) => write!(f, "{}", err),
|
||||
|
||||
15
src/gamelog/Cargo.toml
Normal file
15
src/gamelog/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "gamelog"
|
||||
version = "0.3.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ron = "0.9"
|
||||
|
||||
[dependencies.semver]
|
||||
version = "1.0"
|
||||
features = ["serde"]
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
features = ["derive"]
|
||||
@@ -49,7 +49,7 @@ impl LogFile {
|
||||
fn is_compatible(&self) -> bool {
|
||||
self.clone()
|
||||
.get_min_ver()
|
||||
.cmp_precedence(&super::GAMELOG_MIN_VER)
|
||||
.cmp_precedence(&super::MIN_VER)
|
||||
.is_lt()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ mod period;
|
||||
mod play;
|
||||
mod terrain;
|
||||
|
||||
pub const GAMELOG_MIN_VER: semver::Version = semver::Version::new(0, 2, 0);
|
||||
#[allow(unused)]
|
||||
pub const MIN_VER: semver::Version = semver::Version::new(0, 2, 0);
|
||||
|
||||
pub use file::LogFile;
|
||||
pub use period::*;
|
||||
@@ -1,5 +1,8 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[deprecated(since = "0.2.0", note = "Migrated to Game")]
|
||||
type GameRecord = Game;
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Game {
|
||||
pub version: semver::Version,
|
||||
@@ -19,4 +22,5 @@ pub enum Quarter {
|
||||
Second,
|
||||
Third,
|
||||
Fourth,
|
||||
Overtime(u8),
|
||||
}
|
||||
@@ -7,4 +7,5 @@ pub enum TerrainState {
|
||||
Yards(u8),
|
||||
GoalLine,
|
||||
Inches,
|
||||
Unknown,
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
mod calculator;
|
||||
mod error;
|
||||
mod gamelog;
|
||||
|
||||
use clap::Parser;
|
||||
use core::panic;
|
||||
|
||||
Reference in New Issue
Block a user