Skip to content

Commit

Permalink
style: Run rustfmt with latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
nesium committed Dec 9, 2024
1 parent 5bbb76a commit 8184a0c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
30 changes: 24 additions & 6 deletions crates/prose-store/src/driver/indexed_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ pub struct IndexedDB {
impl Database for IndexedDB {
type Error = Error;

type ReadTransaction<'db> = IndexedDBTransaction<'db, ReadOnly> where Self: 'db;
type ReadWriteTransaction<'db> = IndexedDBTransaction<'db, ReadWrite> where Self: 'db;
type ReadTransaction<'db>
= IndexedDBTransaction<'db, ReadOnly>
where
Self: 'db;
type ReadWriteTransaction<'db>
= IndexedDBTransaction<'db, ReadWrite>
where
Self: 'db;

async fn collection_names(&self) -> Result<Vec<String>, Self::Error> {
Ok(self.db.object_store_names().collect())
Expand All @@ -134,7 +140,10 @@ pub struct IndexedDBUpgradeTransaction<'db> {

impl<'db> UpgradeTransaction<'db> for IndexedDBUpgradeTransaction<'db> {
type Error = Error;
type ReadWriteTransaction<'tx> = IndexedDBTransaction<'tx, ReadWrite> where Self: 'tx;
type ReadWriteTransaction<'tx>
= IndexedDBTransaction<'tx, ReadWrite>
where
Self: 'tx;

fn collection_names(&self) -> Result<Vec<String>, Self::Error> {
Ok(self.db.object_store_names().collect())
Expand Down Expand Up @@ -179,7 +188,10 @@ impl<'db, Mode> ReadTransaction<'db> for IndexedDBTransaction<'db, Mode>
where
Mode: ReadMode,
{
type ReadableCollection<'tx> = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadOnly> where Self: 'tx;
type ReadableCollection<'tx>
= IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadOnly>
where
Self: 'tx;

fn readable_collection(&self, name: &str) -> Result<Self::ReadableCollection<'_>, Self::Error> {
Ok(IndexedDBCollection::new(self.tx.object_store(name)?))
Expand All @@ -191,7 +203,10 @@ impl<'db, Mode> WriteTransaction<'db> for IndexedDBTransaction<'db, Mode>
where
Mode: WriteMode,
{
type WritableCollection<'tx> = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadWrite> where Self: 'tx;
type WritableCollection<'tx>
= IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadWrite>
where
Self: 'tx;

fn writeable_collection(
&self,
Expand Down Expand Up @@ -236,7 +251,10 @@ impl<'tx, Mode> IndexedCollection<'tx> for IndexedDBCollection<'tx, IdbObjectSto
where
Mode: ReadMode,
{
type Index<'coll> = IndexedDBCollection<'coll, IdbIndex<'coll>, Mode> where Self: 'coll;
type Index<'coll>
= IndexedDBCollection<'coll, IdbIndex<'coll>, Mode>
where
Self: 'coll;

fn index(&self, columns: &[&str]) -> Result<Self::Index<'_>, Self::Error> {
let index_name = columns.join("_");
Expand Down
12 changes: 8 additions & 4 deletions crates/prose-store/src/driver/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ pub struct SqliteTransaction<'db, Mode> {

impl<'db> UpgradeTransaction<'db> for SqliteTransaction<'db, Upgrade> {
type Error = Error;
type ReadWriteTransaction<'tx> = SqliteTransaction<'tx, ReadWrite>
type ReadWriteTransaction<'tx>
= SqliteTransaction<'tx, ReadWrite>
where
Self: 'tx;

Expand Down Expand Up @@ -394,7 +395,8 @@ impl<'db, Mode: Send + Sync> ReadTransaction<'db> for SqliteTransaction<'db, Mod
where
Mode: ReadMode,
{
type ReadableCollection<'tx> = SqliteCollection<'tx, ReadOnly>
type ReadableCollection<'tx>
= SqliteCollection<'tx, ReadOnly>
where
Self: 'tx;

Expand All @@ -417,7 +419,8 @@ impl<'db, Mode: Send + Sync> WriteTransaction<'db> for SqliteTransaction<'db, Mo
where
Mode: WriteMode + Sync,
{
type WritableCollection<'tx> = SqliteCollection<'tx, ReadWrite>
type WritableCollection<'tx>
= SqliteCollection<'tx, ReadWrite>
where
Self: 'tx;

Expand Down Expand Up @@ -521,7 +524,8 @@ impl<'tx, Mode: Send> IndexedCollection<'tx> for SqliteCollection<'tx, Mode>
where
Mode: ReadMode + Sync,
{
type Index<'coll> = SqliteCollection<'coll, Mode>
type Index<'coll>
= SqliteCollection<'coll, Mode>
where
Self: 'coll;

Expand Down

0 comments on commit 8184a0c

Please sign in to comment.