Skip to content

Commit

Permalink
all: clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Aug 10, 2024
1 parent 797cbab commit b49f883
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ethercat-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {
.expect("Couldn't write bindings!");

// Generate the EC_IOCTL_ ioctl numbers -- bindgen can't handle them.
let code = fs::read_to_string(&format!("{}/master/ioctl.h", path))
let code = fs::read_to_string(format!("{}/master/ioctl.h", path))
.expect("master/ioctl.h not found");
let mut new = String::new();
for line in code.split('\n') {
Expand Down
11 changes: 3 additions & 8 deletions examples/cyclic-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,12 @@ pub fn main() -> Result<(), io::Error> {
}
}

type SlaveMap = HashMap<SlavePos, HashMap<PdoEntryIndex, (BitLen, Offset)>>;

pub fn init_master(
esi: &EtherCatInfo,
idx: u32,
) -> Result<
(
Master,
DomainIndex,
HashMap<SlavePos, HashMap<PdoEntryIndex, (BitLen, Offset)>>,
),
io::Error,
> {
) -> Result<(Master, DomainIndex, SlaveMap), io::Error> {
let mut master = Master::open(idx, MasterAccess::ReadWrite)?;
log::debug!("Reserve master");
master.reserve()?;
Expand Down
2 changes: 1 addition & 1 deletion src/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl Master {
app_time,
..
} = data;
let first_device = devices.get(0).ok_or_else(|| Error::NoDevices)?;
let first_device = devices.first().ok_or_else(|| Error::NoDevices)?;
let link_up = first_device.link_state != 0;
let scan_busy = scan_busy != 0;
Ok(MasterInfo {
Expand Down

0 comments on commit b49f883

Please sign in to comment.