Skip to content

Commit

Permalink
fix: happy udeps
Browse files Browse the repository at this point in the history
  • Loading branch information
levydsa committed Jan 23, 2025
1 parent 11871ac commit 3bd9ef9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 2 additions & 0 deletions libsql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ sync = [
"parser",
"serde",
"stream",
"remote",
"replication",
"dep:tower",
"dep:hyper",
"dep:http",
Expand Down
24 changes: 11 additions & 13 deletions libsql/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ pub use builder::Builder;
pub use libsql_sys::{Cipher, EncryptionConfig};

use crate::{Connection, Result};
use std::{
fmt,
sync::{atomic::AtomicU64, Arc},
};
use tokio::sync::Mutex;
use std::fmt;
use std::sync::atomic::AtomicU64;

cfg_core! {
bitflags::bitflags! {
Expand Down Expand Up @@ -126,7 +123,7 @@ pub struct Database {
db_type: DbType,
/// The maximum replication index returned from a write performed using any connection created using this Database object.
#[allow(dead_code)]
max_write_replication_index: Arc<AtomicU64>,
max_write_replication_index: std::sync::Arc<AtomicU64>,
}

cfg_core! {
Expand Down Expand Up @@ -551,7 +548,7 @@ impl Database {

let conn = db.connect()?;

let conn = Arc::new(LibsqlConnection { conn });
let conn = std::sync::Arc::new(LibsqlConnection { conn });

Ok(Connection { conn })
}
Expand Down Expand Up @@ -599,7 +596,7 @@ impl Database {
}
}

let conn = Arc::new(LibsqlConnection { conn });
let conn = std::sync::Arc::new(LibsqlConnection { conn });

Ok(Connection { conn })
}
Expand Down Expand Up @@ -645,7 +642,7 @@ impl Database {
writer,
self.max_write_replication_index.clone(),
);
let conn = Arc::new(remote);
let conn = std::sync::Arc::new(remote);

Ok(Connection { conn })
}
Expand All @@ -665,6 +662,7 @@ impl Database {
replication::connection::State,
sync::connection::SyncedConnection,
};
use tokio::sync::Mutex;

let local = db.connect()?;

Expand All @@ -678,14 +676,14 @@ impl Database {
),
read_your_writes: *read_your_writes,
context: db.sync_ctx.clone().unwrap(),
state: Arc::new(Mutex::new(State::Init)),
state: std::sync::Arc::new(Mutex::new(State::Init)),
};

let conn = Arc::new(synced);
let conn = std::sync::Arc::new(synced);
return Ok(Connection { conn });
}

let conn = Arc::new(LibsqlConnection { conn: local });
let conn = std::sync::Arc::new(LibsqlConnection { conn: local });
Ok(Connection { conn })
}

Expand All @@ -696,7 +694,7 @@ impl Database {
connector,
version,
} => {
let conn = Arc::new(
let conn = std::sync::Arc::new(
crate::hrana::connection::HttpConnection::new_with_connector(
url,
auth_token,
Expand Down
3 changes: 2 additions & 1 deletion libsql/src/local/database.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::sync::{Arc, Once};
use std::sync::Once;

cfg_replication!(
use http::uri::InvalidUri;
Expand All @@ -21,6 +21,7 @@ cfg_replication!(
cfg_sync! {
use crate::sync::SyncContext;
use tokio::sync::Mutex;
use std::sync::Arc;
}

use crate::{database::OpenFlags, local::connection::Connection, Error::ConnectionFailed, Result};
Expand Down

0 comments on commit 3bd9ef9

Please sign in to comment.