mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 04:40:47 +01:00
derive tweaks
This commit is contained in:
parent
9ab5d1903f
commit
1ce783ec11
12 changed files with 99 additions and 806 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::event::{param_parse_with, parse_field, ParamIter};
|
||||
use crate::event::{parse_field, ParamIter};
|
||||
use crate::raw_event::RawSubject;
|
||||
use crate::{Error, Event, Result};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::event::{parse_field, ParamIter};
|
||||
use crate::raw_event::RawSubject;
|
||||
use crate::{Event, Result};
|
||||
use crate::Event;
|
||||
|
||||
#[derive(Debug, Event, Clone)]
|
||||
pub struct HealedEvent<'a> {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use crate::{Error, Events, IResult, RawEvent, RawEventType, Result, SubjectId};
|
|||
pub use game::*;
|
||||
pub use medic::*;
|
||||
pub use player::*;
|
||||
use std::borrow::Cow;
|
||||
use std::net::SocketAddr;
|
||||
use std::num::NonZeroU32;
|
||||
use std::str::FromStr;
|
||||
|
|
@ -204,6 +205,12 @@ impl<'a> EventField<'a> for &'a str {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> EventField<'a> for Cow<'a, str> {
|
||||
fn parse_field(input: &'a str) -> Result<Self> {
|
||||
Ok(input.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: EventField<'a>> EventField<'a> for Option<T> {
|
||||
fn parse_field(input: &'a str) -> Result<Self> {
|
||||
T::parse_field(input).map(Some)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use crate::common::{Class, Team};
|
||||
use crate::event::{param_parse_with, parse_field, quoted, ParamIter};
|
||||
use crate::raw_event::{subject_parser, RawSubject};
|
||||
use crate::{Error, Event, Result};
|
||||
use crate::raw_event::RawSubject;
|
||||
use crate::Event;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
#[derive(Debug, Event, Clone)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
/// allow referencing to this crate as `::tf_log_parser` from proc-macros used in this crate
|
||||
extern crate self as tf_log_parser;
|
||||
|
||||
pub use crate::common::{Class, SteamId3, SubjectData, SubjectError, SubjectId};
|
||||
pub use crate::module::EventHandler;
|
||||
use crate::module::{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue