diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-18 18:23:18 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-18 18:23:18 +0200 |
commit | 7ec9b549510db0e96d5d0b9019ee0e6689e3952d (patch) | |
tree | 0ae061d807fb6590f82306be5c4625c3ffde3e8d | |
parent | fix(crates/yt/db/insert/playlist): Account for playlist_len == 0 (diff) | |
download | yt-7ec9b549510db0e96d5d0b9019ee0e6689e3952d.zip |
refactor(crates/yt/db/insert::Commitable): Make `Debug` a dependency
This avoids having to copy the already implied dependency to every type bound.
-rw-r--r-- | crates/yt/src/storage/db/insert/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/yt/src/storage/db/insert/mod.rs b/crates/yt/src/storage/db/insert/mod.rs index e83287a..a3139ac 100644 --- a/crates/yt/src/storage/db/insert/mod.rs +++ b/crates/yt/src/storage/db/insert/mod.rs @@ -11,23 +11,23 @@ pub(crate) mod playlist; pub(crate) mod subscription; pub(crate) mod video; -pub(crate) trait Committable: Sized { +pub(crate) trait Committable: Sized + std::fmt::Debug { async fn commit(self, txn: &mut SqliteConnection) -> Result<()>; } #[derive(Debug)] -pub(crate) struct Operations<O: Committable + std::fmt::Debug> { +pub(crate) struct Operations<O: Committable> { name: &'static str, ops: Vec<O>, } -impl<O: Committable + std::fmt::Debug> Default for Operations<O> { +impl<O: Committable> Default for Operations<O> { fn default() -> Self { Self::new("<default impl>") } } -impl<O: Committable + std::fmt::Debug> Operations<O> { +impl<O: Committable> Operations<O> { #[must_use] pub(crate) fn new(name: &'static str) -> Self { Self { @@ -62,7 +62,7 @@ impl<O: Committable + std::fmt::Debug> Operations<O> { } } -impl<O: Committable + std::fmt::Debug> Drop for Operations<O> { +impl<O: Committable> Drop for Operations<O> { fn drop(&mut self) { assert!( self.ops.is_empty(), |