From bec1b95ad324186a9843e03ca538244da5bdfbf9 Mon Sep 17 00:00:00 2001 From: vffuunnyy Date: Sat, 16 Aug 2025 15:31:30 +0700 Subject: [PATCH] refactor: fix lifetime annotations in draft.rs ci: add cargo retry settings --- .github/workflows/autobuild.yml | 3 +++ .github/workflows/clippy.yml | 3 +++ .github/workflows/dev.yml | 3 +++ .github/workflows/fmt.yml | 3 +++ .gitignore | 1 + src-tauri/src/config/draft.rs | 6 +++--- 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index f6c7c81e..da5f780b 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -193,6 +193,9 @@ jobs: - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu runs-on: ${{ matrix.os }} + env: + CARGO_NET_RETRY: "5" + CARGO_HTTP_CHECK_REVOKE: "false" steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 64392ab3..270080bf 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -17,6 +17,9 @@ jobs: target: x86_64-unknown-linux-gnu runs-on: ${{ matrix.os }} + env: + CARGO_NET_RETRY: "5" + CARGO_HTTP_CHECK_REVOKE: "false" steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 53b771cc..634a9d35 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -28,6 +28,9 @@ jobs: bundle: dmg runs-on: ${{ matrix.os }} + env: + CARGO_NET_RETRY: "5" + CARGO_HTTP_CHECK_REVOKE: "false" steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 3320cba1..335b6165 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -10,6 +10,9 @@ on: jobs: rustfmt: runs-on: ubuntu-latest + env: + CARGO_NET_RETRY: "5" + CARGO_HTTP_CHECK_REVOKE: "false" steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index aa25c632..558caa4f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ scripts/_env.sh .tool-versions .idea .old +bun.lock \ No newline at end of file diff --git a/src-tauri/src/config/draft.rs b/src-tauri/src/config/draft.rs index 97ef7412..4f3b5a56 100644 --- a/src-tauri/src/config/draft.rs +++ b/src-tauri/src/config/draft.rs @@ -19,11 +19,11 @@ macro_rules! draft_define { impl Draft> { #[allow(unused)] - pub fn data(&self) -> MappedMutexGuard> { + pub fn data(&self) -> MappedMutexGuard<'_, Box<$id>> { MutexGuard::map(self.inner.lock(), |guard| &mut guard.0) } - pub fn latest(&self) -> MappedMutexGuard> { + pub fn latest(&self) -> MappedMutexGuard<'_, Box<$id>> { MutexGuard::map(self.inner.lock(), |inner| { if inner.1.is_none() { &mut inner.0 @@ -33,7 +33,7 @@ macro_rules! draft_define { }) } - pub fn draft(&self) -> MappedMutexGuard> { + pub fn draft(&self) -> MappedMutexGuard<'_, Box<$id>> { MutexGuard::map(self.inner.lock(), |inner| { if inner.1.is_none() { inner.1 = Some(inner.0.clone());