From 146c62b5d1e3de5727efe0bdc18d4ca473c2c639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Thu, 20 Jun 2024 09:35:52 +0200 Subject: [PATCH] Fix some nightly build errors (#4657) --- build.rs | 7 +++++++ src/db/models/attachment.rs | 2 +- src/db/models/collection.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index e7bfb7de758..07bd99a73d0 100644 --- a/build.rs +++ b/build.rs @@ -17,6 +17,13 @@ fn main() { "You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite" ); + // Use check-cfg to let cargo know which cfg's we define, + // and avoid warnings when they are used in the code. + println!("cargo::rustc-check-cfg=cfg(sqlite)"); + println!("cargo::rustc-check-cfg=cfg(mysql)"); + println!("cargo::rustc-check-cfg=cfg(postgresql)"); + println!("cargo::rustc-check-cfg=cfg(query_logger)"); + // Rerun when these paths are changed. // Someone could have checked-out a tag or specific commit, but no other files changed. println!("cargo:rerun-if-changed=.git"); diff --git a/src/db/models/attachment.rs b/src/db/models/attachment.rs index f8eca72f687..9e6fa78a7da 100644 --- a/src/db/models/attachment.rs +++ b/src/db/models/attachment.rs @@ -95,7 +95,7 @@ impl Attachment { pub async fn delete(&self, conn: &mut DbConn) -> EmptyResult { db_run! { conn: { - crate::util::retry( + let _: () = crate::util::retry( || diesel::delete(attachments::table.filter(attachments::id.eq(&self.id))).execute(conn), 10, ) diff --git a/src/db/models/collection.rs b/src/db/models/collection.rs index ae70c76c61c..fc3c6e28d3e 100644 --- a/src/db/models/collection.rs +++ b/src/db/models/collection.rs @@ -632,7 +632,7 @@ impl CollectionUser { db_run! { conn: { for user in collectionusers { - diesel::delete(users_collections::table.filter( + let _: () = diesel::delete(users_collections::table.filter( users_collections::user_uuid.eq(user_uuid) .and(users_collections::collection_uuid.eq(user.collection_uuid)) ))