Skip to content

Commit

Permalink
build: update Rust to 1.80.1
Browse files Browse the repository at this point in the history
Required by trustification#703

This also requires us to drop the "mock" feature cfg. It currently is
an undeclared feature, which is a warning now, and might become an error
later.

Declaring that feature and mapping it to `sea-orm/mock` would be the
right thing to do. However, sea-orm will drop the `Clone` implementation
of the connection trait in the case the mock feature is enabled. And
our database struct requires the connection trait to be `Clone`.
Meaning, that we don't support the `mock` feature anyway.
  • Loading branch information
ctron committed Aug 28, 2024
1 parent 1da2e0f commit 3635b34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
11 changes: 5 additions & 6 deletions common/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ impl DerefMut for Database {
}
}

#[crate::db::async_trait::async_trait]
/// Implementation of the connection trait for our database struct.
///
/// **NOTE**: We lack the implementations for the `mock` feature. However, the mock feature would
/// require us to have the `Database` struct to be non-clone, which we don't support anyway.
#[async_trait::async_trait]
impl ConnectionTrait for Database {
fn get_database_backend(&self) -> DbBackend {
self.db.get_database_backend()
Expand All @@ -252,11 +256,6 @@ impl ConnectionTrait for Database {
fn support_returning(&self) -> bool {
self.db.support_returning()
}

#[cfg(feature = "mock")]
fn is_mock_connection(&self) -> bool {
self.db.is_mock_connection()
}
}

/// A trait to help working with database errors
Expand Down
2 changes: 1 addition & 1 deletion modules/fundamental/src/product/endpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn configure(config: &mut web::ServiceConfig, db: Database) {

#[derive(OpenApi)]
#[openapi(
paths(all, delete, get, delete),
paths(all, delete, get),
components(schemas(
crate::product::model::ProductHead,
crate::product::model::ProductVersionHead,
Expand Down
1 change: 1 addition & 0 deletions modules/fundamental/tests/sbom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use trustify_module_ingestor::graph::{
use trustify_module_ingestor::service::Discard;
use trustify_test_context::{document_bytes, TrustifyContext};

#[allow(dead_code)]
pub struct WithContext {
pub sbom: SbomContext,
pub db: Database,
Expand Down

0 comments on commit 3635b34

Please sign in to comment.