We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5150ae commit 6e8aad4Copy full SHA for 6e8aad4
src/replay.rs
@@ -3,7 +3,6 @@ use std::io;
3
use std::io::Read;
4
use std::io::Result as IOResult;
5
use std::io::{Error as IOError, ErrorKind};
6
-use std::u32;
7
8
/// Magic number found at the start of replay files
9
pub const FILE_MAGIC: &[u8] = b"YLPR";
@@ -170,7 +169,7 @@ fn read_str<R: Read>(mut reader: R, length: usize) -> IOResult<String> {
170
169
.position(|&b| b == 0)
171
.expect("Given string does not terminate within given length");
172
173
- Ok(String::from_utf8((&raw_string_bytes[..nul]).to_vec()).unwrap())
+ Ok(String::from_utf8((raw_string_bytes[..nul]).to_vec()).unwrap())
174
}
175
176
impl<R: Read> Replay<R> {
src/telemetry.rs
@@ -441,8 +441,7 @@ impl Sample {
441
442
let raw_val = &self.buffer[vs..ve];
443
444
- let v: Value;
445
- v = match vt {
+ let v: Value = match vt {
446
Value::INT(_) => {
447
if vc == 1 {
448
Value::INT(i32::from_le_bytes(raw_val.try_into().unwrap()))
@@ -478,7 +477,7 @@ impl Sample {
478
477
479
Value::DOUBLE(_) => Value::DOUBLE(f64::from_le_bytes(raw_val.try_into().unwrap())),
480
Value::BITS(_) => Value::BITS(u32::from_le_bytes(raw_val.try_into().unwrap())),
481
- Value::CHAR(_) => Value::CHAR(raw_val[0] as u8),
+ Value::CHAR(_) => Value::CHAR(raw_val[0]),
482
Value::BOOL(_) => {
483
484
Value::BOOL(raw_val[0] > 0)
src/track_surface.rs
@@ -25,15 +25,15 @@ impl From<i32> for TrackSurface {
25
match idx {
26
-1 => TrackSurface::NotInWorld,
27
0 => TrackSurface::Undefined,
28
- 1 | 2 | 3 | 4 => TrackSurface::Asphalt(ix),
+ 1..=4 => TrackSurface::Asphalt(ix),
29
6 | 7 => TrackSurface::Concrete(ix - 4),
30
8 | 9 => TrackSurface::RacingDirt(ix - 7),
31
10 | 11 => TrackSurface::Paint(ix - 9),
32
- 12 | 13 | 14 | 15 => TrackSurface::Rumble(ix - 11),
33
- 16 | 17 | 18 | 19 => TrackSurface::Grass(ix - 15),
34
- 20 | 21 | 22 | 23 => TrackSurface::Dirt(ix - 19),
+ 12..=15 => TrackSurface::Rumble(ix - 11),
+ 16..=19 => TrackSurface::Grass(ix - 15),
+ 20..=23 => TrackSurface::Dirt(ix - 19),
35
24 => TrackSurface::Sand,
36
- 25 | 26 | 27 | 28 => TrackSurface::Gravel(ix - 24),
+ 25..=28 => TrackSurface::Gravel(ix - 24),
37
29 => TrackSurface::Grasscrete,
38
30 => TrackSurface::Astroturf,
39
_ => TrackSurface::Unknown(ix),
0 commit comments