Skip to content

Commit 586af01

Browse files
authored
chore: prepare for release (#50)
* bump msrv and crate version * update CI testing matrix * update readme with new MSRV and crate version * handle macos-specific socket timeout behavior * fmt
1 parent 40d3381 commit 586af01

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ on:
88
jobs:
99
test:
1010
name: Test
11-
runs-on: ubuntu-latest
1211
strategy:
1312
matrix:
1413
toolchain:
15-
- 1.63.0
14+
- 1.71.0
1615
- stable
1716
- nightly
17+
18+
os:
19+
- "ubuntu-latest"
20+
- "macos-latest"
21+
- "windows-latest"
22+
23+
runs-on: ${{ matrix.os }}
24+
1825
steps:
1926
- uses: actions/checkout@v4
2027
- uses: actions-rust-lang/setup-rust-toolchain@v1

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "ads"
3-
version = "0.4.4"
3+
version = "0.5.0"
44
edition = "2018"
55
authors = ["Georg Brandl <g.brandl@fz-juelich.de>"]
66
license = "MIT/Apache-2.0"
77
description = "Client for the Beckhoff Automation Device Specification protocol for PLCs"
88
repository = "https://github.com/birkenfeld/ads-rs"
99
keywords = ["Beckhoff", "ADS", "automation", "device", "PLC"]
10-
rust-version = "1.63"
10+
rust-version = "1.71"
1111

1212
[dependencies]
1313
byteorder = "1.5.0"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Use with Cargo as usual, no system dependencies are required.
1313

1414
```toml
1515
[dependencies]
16-
ads = "0.4"
16+
ads = "0.5"
1717
```
1818

1919
### Rust version
2020

21-
Minimum supported Rust version is 1.63.0.
21+
Minimum supported Rust version is 1.71.0.
2222

2323
## Usage
2424

@@ -68,3 +68,4 @@ routes automatically.
6868

6969
A utility called `adstool` is found under `examples/`, very similar to the one
7070
provided by [the C++ library](https://github.com/Beckhoff/ADS).
71+

src/test/test_client.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,24 @@ fn test_timeout() {
2626
run_test(
2727
ServerOpts { timeout: Some(Duration::from_millis(1)), ..Default::default() },
2828
|device| {
29+
use std::io::ErrorKind;
2930
let err = device.get_info().unwrap_err();
31+
32+
// darwin (maybe other BSDs too?) kernel seems to return `WouldBlock` on timeout
33+
// linux/windows align on returning `TimedOut`, which makes more sense semantically
34+
let expected_err = {
35+
#[cfg(target_os = "macos")]
36+
{
37+
ErrorKind::WouldBlock
38+
}
39+
#[cfg(not(target_os = "macos"))]
40+
{
41+
ErrorKind::TimedOut
42+
}
43+
};
44+
3045
match err {
31-
Error::Io(_, err) if matches!(err.kind(), std::io::ErrorKind::TimedOut) => (),
46+
Error::Io(_, err) if err.kind() == expected_err => (),
3247
_ => panic!("unexpected error from timeout: {}", err),
3348
}
3449
},

0 commit comments

Comments
 (0)