Skip to content

Commit

Permalink
fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Nov 15, 2023
1 parent 1da8339 commit 9fd18b0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions libsql-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,13 @@ where
if let Some(soft_limit_mb) = self.db_config.soft_heap_limit_mb {
tracing::warn!("Setting soft heap limit to {soft_limit_mb}MiB");
unsafe {
sqld_libsql_bindings::ffi::sqlite3_soft_heap_limit64(
soft_limit_mb as i64 * 1024 * 1024,
)
libsql_sys::ffi::sqlite3_soft_heap_limit64(soft_limit_mb as i64 * 1024 * 1024)
};
}
if let Some(hard_limit_mb) = self.db_config.hard_heap_limit_mb {
tracing::warn!("Setting hard heap limit to {hard_limit_mb}MiB");
unsafe {
sqld_libsql_bindings::ffi::sqlite3_hard_heap_limit64(
hard_limit_mb as i64 * 1024 * 1024,
)
libsql_sys::ffi::sqlite3_hard_heap_limit64(hard_limit_mb as i64 * 1024 * 1024)
};
}
}
Expand Down Expand Up @@ -330,7 +326,7 @@ where
let heartbeat_auth = config.heartbeat_auth.clone();
let heartbeat_period = config.heartbeat_period;
let heartbeat_url = if let Some(url) = &config.heartbeat_url {
Some(Url::from_str(&url).context("invalid heartbeat URL")?)
Some(Url::from_str(url).context("invalid heartbeat URL")?)
} else {
None
};
Expand Down
2 changes: 1 addition & 1 deletion libsql/src/hrana/hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct HttpSender {

impl HttpSender {
pub fn new(connector: ConnectorService, version: Option<&str>) -> Self {
let ver = version.unwrap_or_else(|| env!("CARGO_PKG_VERSION"));
let ver = version.unwrap_or(env!("CARGO_PKG_VERSION"));

let version = HeaderValue::try_from(format!("libsql-remote-{ver}")).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion libsql/src/local/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Database {
connector,
endpoint.as_str().try_into().unwrap(),
auth_token,
version.as_ref().map(String::as_str),
version.as_deref(),
)
.unwrap();
let path = PathBuf::from(db_path);
Expand Down
2 changes: 1 addition & 1 deletion libsql/src/replication/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Client {
auth_token: impl AsRef<str>,
version: Option<&str>,
) -> anyhow::Result<Self> {
let ver = version.unwrap_or_else(|| env!("CARGO_PKG_VERSION"));
let ver = version.unwrap_or(env!("CARGO_PKG_VERSION"));

let version: AsciiMetadataValue = format!("libsql-rpc-{ver}")
.try_into()
Expand Down

0 comments on commit 9fd18b0

Please sign in to comment.