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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.63.0
- 1.71.0
- stable
- nightly
env:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repository = "https://github.com/ethercat-rs/ethercat"
readme = "README.md"
license = "MIT/Apache-2.0"
edition = "2018"
rust-version = "1.71"

[dependencies]
derive-new = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Bindings have been pregenerated for the tag `1.6.1` - if you activate the
feature `pregenerated-bindings`, you don't need the master code to build, but
the kernel modules must match that revision.

The minimum tested Rust version is 1.63.0.
The minimum tested Rust version is 1.71.0.

# Licensing

Expand Down
3 changes: 1 addition & 2 deletions examples/cyclic-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,10 @@
}

let cfg_index = config.index();
let cfg_info = master.get_config_info(cfg_index)?;

Check warning on line 155 in examples/cyclic-data.rs

View workflow job for this annotation

GitHub Actions / fmt

Diff in /home/runner/work/ethercat/ethercat/examples/cyclic-data.rs
log::info!("Config info: {:#?}", cfg_info);
if cfg_info.slave_position.is_none() {
return Err(io::Error::new(
io::ErrorKind::Other,
return Err(io::Error::other(
"Unable to configure slave",
));
}
Expand Down
5 changes: 2 additions & 3 deletions examples/foe-read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
fn main() -> Result<(), std::io::Error> {
let mut master = Master::open(0, MasterAccess::ReadWrite)?;

let args: Vec<String> = std::env::args().collect();

Check warning on line 6 in examples/foe-read.rs

View workflow job for this annotation

GitHub Actions / fmt

Diff in /home/runner/work/ethercat/ethercat/examples/foe-read.rs
if args.len() < 3 {
eprintln!("Usage: foe-read <slave-position> <foe-name>");
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(std::io::Error::other(
"Not enough arguments",
));
}
let slave_idx: ethercat::SlavePos = args[1]
.parse::<u16>()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?
.map_err(std::io::Error::other)?
.into();
let foe_name = &args[2];
let res = master.foe_read(slave_idx, foe_name)?;
Expand Down
5 changes: 2 additions & 3 deletions examples/foe-write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
fn main() -> Result<(), std::io::Error> {
let mut master = Master::open(0, MasterAccess::ReadWrite)?;

let args: Vec<String> = std::env::args().collect();

Check warning on line 6 in examples/foe-write.rs

View workflow job for this annotation

GitHub Actions / fmt

Diff in /home/runner/work/ethercat/ethercat/examples/foe-write.rs
if args.len() < 4 {
eprintln!("Usage: foe-read <slave-position> <foe-name> <file>");
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(std::io::Error::other(
"Not enough arguments",
));
}
let slave_idx = args[1]
.parse::<u16>()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?
.map_err(std::io::Error::other)?
.into();
let foe_name = &args[2];
let file = &args[3];
Expand Down
8 changes: 6 additions & 2 deletions src/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Master {
Ok((ioctl!(self, ec::ioctl::CREATE_DOMAIN)? as usize).into())
}

pub const fn domain(&self, idx: DomainIdx) -> Domain {
pub const fn domain(&self, idx: DomainIdx) -> Domain<'_> {
Domain::new(idx, self)
}

Expand Down Expand Up @@ -265,7 +265,11 @@ impl Master {
})
}

pub fn configure_slave(&mut self, addr: SlaveAddr, expected: SlaveId) -> Result<SlaveConfig> {
pub fn configure_slave(
&mut self,
addr: SlaveAddr,
expected: SlaveId,
) -> Result<SlaveConfig<'_>> {
log::debug!("Configure slave {:?}", addr);
let mut data = ec::ec_ioctl_config_t::default();
let (alias, pos) = addr.as_pair();
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

impl From<Error> for io::Error {
fn from(e: Error) -> Self {
io::Error::new(io::ErrorKind::Other, e)
io::Error::other(e)

Check failure on line 33 in src/types.rs

View workflow job for this annotation

GitHub Actions / build (1.71.0)

use of unstable library feature 'io_error_other'

Check failure on line 33 in src/types.rs

View workflow job for this annotation

GitHub Actions / build (stable)

current MSRV (Minimum Supported Rust Version) is `1.71.0` but this item is stable since `1.74.0`

Check failure on line 33 in src/types.rs

View workflow job for this annotation

GitHub Actions / build (nightly)

current MSRV (Minimum Supported Rust Version) is `1.71.0` but this item is stable since `1.74.0`
}
}

Expand Down
Loading