From 92fb8703aafc9a5639c7ddab651eec10fd91a041 Mon Sep 17 00:00:00 2001 From: Al Liu Date: Mon, 23 Dec 2024 11:19:00 +0800 Subject: [PATCH] relax-trait-bounds (#56) --- .github/workflows/python.yml.bk | 119 -------------------------------- core/src/state.rs | 2 - core/src/suspicion.rs | 3 - core/src/transport.rs | 2 +- core/src/transport/lpe.rs | 6 +- types/src/message.rs | 6 +- 6 files changed, 5 insertions(+), 133 deletions(-) delete mode 100644 .github/workflows/python.yml.bk diff --git a/.github/workflows/python.yml.bk b/.github/workflows/python.yml.bk deleted file mode 100644 index 492a21f..0000000 --- a/.github/workflows/python.yml.bk +++ /dev/null @@ -1,119 +0,0 @@ -name: python - -on: - push: - branches: - - main - - master - tags: - - '*' - pull_request: - workflow_dispatch: - -permissions: - contents: read - -jobs: - linux: - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - working-directory: py - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' - manylinux: auto - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - windows: - runs-on: windows-latest - strategy: - matrix: - target: [x64, x86] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - architecture: ${{ matrix.target }} - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - working-directory: py - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - macos: - runs-on: macos-latest - strategy: - matrix: - target: [x86_64, aarch64] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - working-directory: py - target: ${{ matrix.target }} - args: --release --out ../dist --find-interpreter - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build sdist - uses: PyO3/maturin-action@v1 - with: - working-directory: py - command: sdist - args: --out ../dist - - name: Upload sdist - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - release: - name: Release - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" - needs: [linux, windows, macos, sdist] - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - - name: Publish to PyPI - uses: PyO3/maturin-action@v1 - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - with: - command: upload - args: --skip-existing * diff --git a/core/src/state.rs b/core/src/state.rs index 7e86233..265f0d9 100644 --- a/core/src/state.rs +++ b/core/src/state.rs @@ -136,7 +136,6 @@ impl Memberlist where D: Delegate::ResolvedAddress>, T: Transport, - T::Id: Send + Sync + 'static, { /// Does a complete state exchange with a specific node. pub(crate) async fn push_pull_node( @@ -578,7 +577,6 @@ enum StateMessage { impl StateMessage where T: Transport, - T::Id: Send + Sync + 'static, { async fn run(self, s: &Memberlist) where diff --git a/core/src/suspicion.rs b/core/src/suspicion.rs index 82b2462..023506c 100644 --- a/core/src/suspicion.rs +++ b/core/src/suspicion.rs @@ -46,7 +46,6 @@ where impl Suspicioner where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { pub(crate) fn new( @@ -138,7 +137,6 @@ where impl Suspicion where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { /// Returns a after_func started with the max time, and that will drive @@ -180,7 +178,6 @@ where impl Suspicion where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { /// Confirm registers that a possibly new peer has also determined the given diff --git a/core/src/transport.rs b/core/src/transport.rs index 801bdcf..a851052 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -273,7 +273,7 @@ pub trait Transport: Sized + Send + Sync + 'static { /// The error type for the transport type Error: TransportError; /// The id type used to identify nodes - type Id: Id + Send + Sync + 'static; + type Id: Id; /// The address resolver used to resolve addresses type Resolver: AddressResolver; /// The promised stream used to send and receive messages diff --git a/core/src/transport/lpe.rs b/core/src/transport/lpe.rs index 7f328e6..31a9827 100644 --- a/core/src/transport/lpe.rs +++ b/core/src/transport/lpe.rs @@ -47,10 +47,8 @@ impl core::fmt::Display for Lpe { impl Wire for Lpe where - I: Transformable + core::fmt::Debug + Send + Sync + 'static, - I::Error: Send + Sync + 'static, - A: Transformable + core::fmt::Debug + Send + Sync + 'static, - A::Error: Send + Sync + 'static, + I: Transformable + core::fmt::Debug, + A: Transformable + core::fmt::Debug, { type Error = MessageTransformError; type Id = I; diff --git a/types/src/message.rs b/types/src/message.rs index 73c3bbf..631ab81 100644 --- a/types/src/message.rs +++ b/types/src/message.rs @@ -186,10 +186,8 @@ const INLINED_BYTES_SIZE: usize = 64; impl Transformable for Message where - I: Transformable + core::fmt::Debug + 'static, - I::Error: Send + Sync + 'static, - A: Transformable + core::fmt::Debug + 'static, - A::Error: Send + Sync + 'static, + I: Transformable + core::fmt::Debug, + A: Transformable + core::fmt::Debug, { type Error = MessageTransformError;