Skip to content

Commit

Permalink
Remove worstrun support
Browse files Browse the repository at this point in the history
They recently removed splits entirely from worstrun. So it doesn't make
sense for us to still continue parsing their splits.
  • Loading branch information
CryZe committed Feb 20, 2021
1 parent 8599820 commit 7649b48
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 154 deletions.
23 changes: 6 additions & 17 deletions src/run/parser/composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
use super::{
face_split, flitter, livesplit, llanfair, llanfair2, llanfair_gered, portal2_live_timer,
shit_split, source_live_timer, splits_io, splitterino, splitterz, splitty, time_split_tracker,
urn, worstrun, wsplit, TimerKind,
urn, wsplit, TimerKind,
};
use crate::Run;
use core::result::Result as StdResult;
use snafu::ResultExt;
use std::io::{self, BufRead, Seek, SeekFrom};
use std::path::PathBuf;
use std::{
io::{self, BufRead, Seek, SeekFrom},
path::PathBuf,
};

/// The Error type for splits files that couldn't be parsed by the Composite
/// Parser.
Expand Down Expand Up @@ -180,20 +182,7 @@ where
return Ok(parsed(run, TimerKind::SourceLiveTimer));
}

// Both worstrun and Urn accept entirely empty JSON files. Therefore it's
// very hard to determine which format we should be parsing those files as.
// We poke at the format first to see if there's a game and category key in
// there. If there is then we assume it's a worstrun file. This is somewhat
// suboptimal as we parse worstrun files that don't have those keys (they
// are optional) as Urn files.
source.seek(SeekFrom::Start(0)).context(SeekBack)?;
if worstrun::poke(&mut source) {
source.seek(SeekFrom::Start(0)).context(SeekBack)?;
if let Ok(run) = worstrun::parse(&mut source) {
return Ok(parsed(run, TimerKind::Worstrun));
}
}

// Urn accepts entirely empty JSON files.
source.seek(SeekFrom::Start(0)).context(SeekBack)?;
if let Ok(run) = urn::parse(&mut source) {
return Ok(parsed(run, TimerKind::Urn));
Expand Down
1 change: 0 additions & 1 deletion src/run/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ pub mod splitterz;
pub mod splitty;
pub mod time_split_tracker;
pub mod urn;
pub mod worstrun;
pub mod wsplit;

mod timer_kind;
Expand Down
3 changes: 0 additions & 3 deletions src/run/parser/timer_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ pub enum TimerKind {
Urn,
/// SourceLiveTimer
SourceLiveTimer,
/// Worstrun
Worstrun,
/// Splitterino
Splitterino,
/// A Generic Timer. The name of the timer is associated with the variant.
Expand All @@ -57,7 +55,6 @@ impl fmt::Display for TimerKind {
TimerKind::Llanfair2 => write!(f, "Llanfair Rewrite"),
TimerKind::Urn => write!(f, "Urn"),
TimerKind::SourceLiveTimer => write!(f, "SourceLiveTimer"),
TimerKind::Worstrun => write!(f, "worstrun"),
TimerKind::Splitterino => write!(f, "Splitterino"),
TimerKind::Generic(name) => write!(f, "{}", name),
}
Expand Down
133 changes: 0 additions & 133 deletions src/run/parser/worstrun.rs

This file was deleted.

0 comments on commit 7649b48

Please sign in to comment.