Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ telemetry = ["winapi"]
bitflags = "1.2"
chrono = "0.4"
encoding_rs = "0.8"
libc = { version = "0.2", optional = true }
serde = {version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
winapi = {version = "0.3.9", features = ["std","memoryapi","winnt","errhandlingapi","synchapi","handleapi"], optional = true }
thiserror = "1.0"
winapi = {version = "0.3", features = ["std","memoryapi","winnt","errhandlingapi","synchapi","handleapi"], optional = true }

[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
2 changes: 1 addition & 1 deletion examples/dump_sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde_yaml::to_string;

pub fn main() {
let conn = Connection::new().expect("Unable to open telemetry");
let telem = conn.telemetry().expect("Telem");
let telem = conn.telemetry();

print!("{}", to_string(&telem.all()).unwrap());
}
3 changes: 1 addition & 2 deletions examples/get_telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::convert::TryInto;
use std::time::Duration;

pub fn main() {
let mut conn = Connection::new().expect("Unable to open telemetry");

let conn = Connection::new().expect("Unable to open telemetry");
let session = conn.session_info().expect("Invalid Session");

let shift_up_rpm = session.drivers.shift_light_shift_rpm;
Expand Down
2 changes: 1 addition & 1 deletion examples/view_session.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use iracing::telemetry::Connection;

pub fn main() {
let mut conn = Connection::new().expect("Unable to open telemetry");
let conn = Connection::new().expect("Unable to open telemetry");
let session = conn.session_info().expect("Invalid session data");

print!("{:#?}", session);
Expand Down
3 changes: 1 addition & 2 deletions src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::io;
use std::io::Read;
use std::io::Result as IOResult;
use std::io::{Error as IOError, ErrorKind};
use std::u32;

/// Magic number found at the start of replay files
pub const FILE_MAGIC: &[u8] = b"YLPR";
Expand Down Expand Up @@ -170,7 +169,7 @@ fn read_str<R: Read>(mut reader: R, length: usize) -> IOResult<String> {
.position(|&b| b == 0)
.expect("Given string does not terminate within given length");

Ok(String::from_utf8((&raw_string_bytes[..nul]).to_vec()).unwrap())
Ok(String::from_utf8((raw_string_bytes[..nul]).to_vec()).unwrap())
}

impl<R: Read> Replay<R> {
Expand Down
Loading