From 4d4c6b6690d8ee1abff68d87fc6d0d0469412101 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 23 Apr 2018 15:26:02 +0200 Subject: apply clippy's suggestions --- src/event.rs | 2 +- src/lib.rs | 4 +-- src/raw/parser.rs | 76 +++++++++++++++++++++++++++---------------------------- src/raw/types.rs | 4 +-- 4 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/event.rs b/src/event.rs index 2ae3f05..83c569e 100644 --- a/src/event.rs +++ b/src/event.rs @@ -219,7 +219,7 @@ impl Event { }; Some(Event { time: raw_event.time, - kind: kind, + kind, is_ninety: raw_event.is_ninety, is_fifty: raw_event.is_fifty, is_moving: raw_event.is_moving, diff --git a/src/lib.rs b/src/lib.rs index aff6f2e..5b0d808 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,12 +119,12 @@ fn setup_agents(data: &raw::Evtc) -> Result, EvtcError> { let agent = Agent { addr: raw_agent.addr, - kind: kind, + kind, toughness: raw_agent.toughness, concentration: raw_agent.concentration, healing: raw_agent.healing, condition: raw_agent.condition, - name: name, + name, instance_id: 0, first_aware: 0, last_aware: u64::max_value(), diff --git a/src/raw/parser.rs b/src/raw/parser.rs index 7163265..11e892b 100644 --- a/src/raw/parser.rs +++ b/src/raw/parser.rs @@ -143,8 +143,8 @@ pub fn parse_header(input: &mut T) -> ParseResult
{ Ok(Header { arcdps_build: build_string, - combat_id: combat_id, - agent_count: agent_count, + combat_id, + agent_count, }) } @@ -188,14 +188,14 @@ pub fn parse_agent(input: &mut T) -> ParseResult { input.read_exact(&mut skip)?; Ok(Agent { - addr: addr, - prof: prof, - is_elite: is_elite, - toughness: toughness, - concentration: concentration, - healing: healing, - condition: condition, - name: name, + addr, + prof, + is_elite, + toughness, + concentration, + healing, + condition, + name, }) } @@ -218,7 +218,7 @@ pub fn parse_skill(input: &mut T) -> ParseResult { let id = input.read_i32::()?; let mut name = [0; 64]; input.read_exact(&mut name)?; - Ok(Skill { id: id, name: name }) + Ok(Skill { id, name }) } /// Parse all combat events. @@ -231,7 +231,7 @@ pub fn parse_events(input: &mut T) -> ParseResult> { match event { Ok(x) => result.push(x), Err(ParseError::Io(ref e)) if e.kind() == ErrorKind::UnexpectedEof => return Ok(result), - Err(e) => return Err(e.into()), + Err(e) => return Err(e), } } } @@ -271,27 +271,27 @@ pub fn parse_event(input: &mut T) -> ParseResult { input.read_u16::()?; Ok(CbtEvent { - time: time, - src_agent: src_agent, - dst_agent: dst_agent, - value: value, - buff_dmg: buff_dmg, - overstack_value: overstack_value, - skillid: skillid, - src_instid: src_instid, - dst_instid: dst_instid, - src_master_instid: src_master_instid, - iff: iff, - buff: buff, - result: result, - is_activation: is_activation, - is_buffremove: is_buffremove, - is_ninety: is_ninety, - is_fifty: is_fifty, - is_moving: is_moving, - is_statechange: is_statechange, - is_flanking: is_flanking, - is_shields: is_shields, + time, + src_agent, + dst_agent, + value, + buff_dmg, + overstack_value, + skillid, + src_instid, + dst_instid, + src_master_instid, + iff, + buff, + result, + is_activation, + is_buffremove, + is_ninety, + is_fifty, + is_moving, + is_statechange, + is_flanking, + is_shields, }) } @@ -306,10 +306,10 @@ pub fn parse_file(input: &mut T) -> ParseResult { let events = parse_events(input)?; Ok(Evtc { - header: header, - skill_count: skill_count, - agents: agents, - skills: skills, - events: events, + header, + skill_count, + agents, + skills, + events, }) } diff --git a/src/raw/types.rs b/src/raw/types.rs index f616398..9096a32 100644 --- a/src/raw/types.rs +++ b/src/raw/types.rs @@ -240,7 +240,7 @@ impl Agent { /// Gadgets are entities spawned by some skills, like the "Binding Roots" /// spawned by Entangle. pub fn is_gadget(&self) -> bool { - self.is_elite == std::u32::MAX && (self.prof & 0xffff0000) == 0xffff0000 + self.is_elite == std::u32::MAX && (self.prof & 0xffff_0000) == 0xffff_0000 } /// Checks whether this agent is a character. @@ -248,7 +248,7 @@ impl Agent { /// Characters are entities like clones, pets, minions, spirits, but also /// minis. pub fn is_character(&self) -> bool { - self.is_elite == std::u32::MAX && (self.prof & 0xffff0000) != 0xffff0000 + self.is_elite == std::u32::MAX && (self.prof & 0xffff_0000) != 0xffff_0000 } /// Checks whether this agent is a player. -- cgit v1.2.3