Skip to content

Commit

Permalink
Merge pull request #420 from CryZe/remove-llanfair-2
Browse files Browse the repository at this point in the history
Remove Support for Llanfair 2
  • Loading branch information
CryZe authored Mar 26, 2021
2 parents 373cbd4 + 9277d96 commit 13ee569
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 566 deletions.
13 changes: 3 additions & 10 deletions src/run/parser/composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
//! ```
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, wsplit, TimerKind,
face_split, flitter, livesplit, llanfair, llanfair_gered, portal2_live_timer, shit_split,
source_live_timer, splits_io, splitterino, splitterz, splitty, time_split_tracker, urn, wsplit,
TimerKind,
};
use crate::Run;
use core::result::Result as StdResult;
Expand Down Expand Up @@ -153,13 +153,6 @@ where
return Ok(parsed(run, TimerKind::LlanfairGered));
}

// Llanfair 2's format is almost entirely optional so it should be parsed
// after all other XML based formats.
source.seek(SeekFrom::Start(0)).context(SeekBack)?;
if let Ok(run) = llanfair2::parse(&mut source) {
return Ok(parsed(run, TimerKind::Llanfair2));
}

source.seek(SeekFrom::Start(0)).context(SeekBack)?;
if let Ok((run, timer)) = splits_io::parse(&mut source) {
return Ok(parsed(run, TimerKind::Generic(timer)));
Expand Down
47 changes: 23 additions & 24 deletions src/run/parser/flitter/s_expressions.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Implements a serde deserializer for S-Expressions.
//! http://people.csail.mit.edu/rivest/Sexp.txt
use core::fmt::Display;
use core::num::ParseIntError;
use core::{fmt::Display, num::ParseIntError};
use serde::de::{self, DeserializeOwned, DeserializeSeed, MapAccess, SeqAccess, Visitor};
use std::io::{self, BufRead};
use utf8::{BufReadDecoder, BufReadDecoderError};
Expand All @@ -27,7 +26,7 @@ pub enum Error {
source: ParseIntError,
},
/// Encountered invalid UTF-8 sequence.
InvalidUTF8,
InvalidUtf8,
/// Failed to read from the source.
Io {
/// The underlying error.
Expand All @@ -44,7 +43,7 @@ pub enum Error {
impl From<BufReadDecoderError<'_>> for Error {
fn from(error: BufReadDecoderError<'_>) -> Error {
match error {
BufReadDecoderError::InvalidByteSequence(_) => Error::InvalidUTF8,
BufReadDecoderError::InvalidByteSequence(_) => Error::InvalidUtf8,
BufReadDecoderError::Io(source) => Error::Io { source },
}
}
Expand Down Expand Up @@ -213,49 +212,49 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_bool<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_i8<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_i16<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_i32<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_i64<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_u8<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_u16<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value>
where
Expand All @@ -267,25 +266,25 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_f32<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_f64<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_char<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value>
where
Expand All @@ -303,13 +302,13 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_byte_buf<V>(self, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value>
where
Expand All @@ -321,19 +320,19 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_unit_struct<V>(self, _name: &'static str, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_newtype_struct<V>(self, _name: &'static str, _visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_seq<V>(mut self, visitor: V) -> Result<V::Value>
where
Expand All @@ -355,7 +354,7 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_tuple_struct<V>(
self,
Expand All @@ -366,7 +365,7 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_map<V>(mut self, visitor: V) -> Result<V::Value>
where
Expand Down Expand Up @@ -404,7 +403,7 @@ impl<'de, B: BufRead> de::Deserializer<'de> for &mut Deserializer<B> {
where
V: Visitor<'de>,
{
unimplemented!()
unreachable!()
}
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value>
where
Expand Down
Loading

0 comments on commit 13ee569

Please sign in to comment.