Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
... some are still left, related to rust-lang/rust-clippy#5812
  • Loading branch information
psarna committed Jan 2, 2024
1 parent fbae239 commit 8d66466
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libsql-server/src/connection/libsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl LibSqlConnection<libsql_sys::wal::Sqlite3Wal> {
Arc::new([]),
libsql_sys::wal::Sqlite3WalManager::new(),
Default::default(),
MetaStoreHandle::new_test().into(),
MetaStoreHandle::new_test(),
QueryBuilderConfig::default(),
rcv,
Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion libsql-server/src/namespace/fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl ForkTask<'_> {
// PrimaryNamespaceMaker::create ignores
// reset_cb param
Box::new(|_op| {}),
&self.meta_store,
self.meta_store,
)
.await
.map_err(|e| ForkError::CreateNamespace(Box::new(e)))
Expand Down
2 changes: 1 addition & 1 deletion libsql-server/src/namespace/meta_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl MetaStoreHandle {

let config_path = db_path.as_ref().join("config.json");

let config = match fs::read(&config_path) {
let config = match fs::read(config_path) {
Ok(data) => serde_json::from_slice(&data)?,
Err(err) if err.kind() == io::ErrorKind::NotFound => DatabaseConfig::default(),
Err(err) => return Err(Error::IOError(err)),
Expand Down
7 changes: 7 additions & 0 deletions libsql-server/src/namespace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ impl<'de> Deserialize<'de> for NamespaceName {
{
NamespaceName::from_string(v).map_err(|e| E::custom(e))
}

fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
where
E: serde::de::Error,
{
NamespaceName::from_string(v.to_string()).map_err(|e| E::custom(e))
}
}

deserializer.deserialize_string(V)
Expand Down

0 comments on commit 8d66466

Please sign in to comment.