Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Nov 25, 2024
1 parent 396adf7 commit 421292a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ jobs:
build_n_test_openharmony:
strategy:
matrix:
target:
[
aarch64-unknown-linux-ohos,
armv7-unknown-linux-ohos,
x86_64-unknown-linux-ohos,
]
target: [aarch64-unknown-linux-ohos, armv7-unknown-linux-ohos, x86_64-unknown-linux-ohos]
fail-fast: false
runs-on: ubuntu-latest

Expand All @@ -105,9 +100,11 @@ jobs:
run: |
cargo install --locked ohrs
rustup target add ${{ matrix.target }}
- name: clippy
- name: fmt & clippy
if: ${{ !cancelled() }}
run: ohrs cargo --disable-target -- clippy --target ${{matrix.target}} --all-features --features="async tokio/rt-multi-thread" -- -D warnings
run: |
ohrs cargo --disable-target -- fmt --all -- --check
ohrs cargo --disable-target -- clippy --target ${{matrix.target}} --all-features --features="async tokio/rt-multi-thread" -- -D warnings
- name: Build
if: ${{ !cancelled() }}
run: |
Expand Down
14 changes: 2 additions & 12 deletions src/platform/posix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,8 @@
//! POSIX compliant support.
mod sockaddr;
#[cfg(any(
all(target_os = "linux", not(target_env = "ohos")),
target_os = "freebsd",
target_os = "macos"
))]
pub(crate) use sockaddr::sockaddr_union;

#[cfg(any(
all(target_os = "linux", not(target_env = "ohos")),
target_os = "macos"
))]
pub(crate) use sockaddr::ipaddr_to_sockaddr;
#[allow(unused_imports)]
pub(crate) use sockaddr::{ipaddr_to_sockaddr, sockaddr_union};

mod fd;
pub(crate) use self::fd::Fd;
Expand Down
4 changes: 0 additions & 4 deletions src/platform/posix/sockaddr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ fn rs_addr_to_sockaddr(addr: std::net::SocketAddr) -> sockaddr_union {

/// # Safety
/// Fill the `addr` with the `src_addr` and `src_port`, the `size` should be the size of overwriting
#[cfg(any(
all(target_os = "linux", not(target_env = "ohos")),
target_os = "macos"
))]
pub(crate) unsafe fn ipaddr_to_sockaddr<T>(
src_addr: T,
src_port: u16,
Expand Down

0 comments on commit 421292a

Please sign in to comment.