Skip to content
Merged
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: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -28,7 +28,7 @@ jobs:
components: clippy

- name: Cache .cargo and target
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cargo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -29,7 +29,7 @@ jobs:
components: rustfmt

- name: Cache .cargo and target
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cargo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Rust
uses: actions-rs/toolchain@v1
Expand All @@ -49,7 +49,7 @@ jobs:

- name: Install `cargo-edit`
run: cargo install cargo-edit

- id: cargo-set-version
name: Set Version
run: cargo set-version --bump ${{ inputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -28,7 +28,7 @@ jobs:
override: true

- name: Cache .cargo and target
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cargo
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ readme = "README.md"
serde = { version = "1.0.183", features = ["derive"], optional = true}
thiserror = "1.0"

[target.'cfg(target_family = "unix")'.build-dependencies]
cc = "1.0.73"

[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
libc = "0.2.101"

[target.'cfg(any(target_os = "ios", target_os = "macos", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly"))'.dependencies]
libc = "0.2.101"

[target.'cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly"))'.build-dependencies]
cc = "1.0.73"

[target.'cfg(target_os = "windows")'.dependencies]
libc = "0.2.101"
winapi = {version = "0.3", features = ["ws2def", "ws2ipdef", "netioapi", "iphlpapi", "iptypes", "ntdef", "winerror"] }
Expand Down
9 changes: 1 addition & 8 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
fn main() {
#[cfg(any(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By doing this the build script will also run for Windows.

Perhaps we could constraint this to run on OS Family Unix only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, target_family seems a good way to allow build.rs to be run on linux while preventing it to be run on Windows. I don't think the use case of cross compiling from Windows to Freebsd will happen any time soon (I don't even know if that's actually possible). I fixed it in 7d45bff

target_os = "macos",
target_os = "ios",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonfly"
))]
#[cfg(target_family = "unix")]
{
use cc::Build;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl<'a> HexSlice<'a> {
}
}

impl<'a> Display for HexSlice<'a> {
impl Display for HexSlice<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (index, byte) in self.0.iter().enumerate() {
if index > 0 {
Expand Down
Loading