Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2024-10-15 03:42:52 +00:00 committed by GitHub
parent a27de55882
commit 4727de6f03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 11 deletions

View File

@ -220,9 +220,7 @@ pub async fn provider(
// this merely describes whether our provider is available to other nodes
// and if so, which nodes are allowed to access it (public/whitelist/blacklist)
let access_settings: AccessSettings =
match tokio::fs::read_to_string(home_directory_path.join(".eth_access_settings"))
.await
{
match tokio::fs::read_to_string(home_directory_path.join(".eth_access_settings")).await {
Ok(contents) => serde_json::from_str(&contents).unwrap(),
Err(_) => {
let access_settings = AccessSettings {

View File

@ -64,11 +64,15 @@ impl KvState {
#[cfg(unix)]
let db_path = self.kv_path.join(format!("{package_id}")).join(&db);
#[cfg(target_os = "windows")]
let db_path = self.kv_path
.join(format!("{}_{}", package_id._package(), package_id._publisher()))
let db_path = self
.kv_path
.join(format!(
"{}_{}",
package_id._package(),
package_id._publisher()
))
.join(&db);
fs::create_dir_all(&db_path).await?;
self.open_kvs.insert(
@ -509,12 +513,18 @@ async fn check_caps(
.await;
#[cfg(unix)]
let db_path = state.kv_path
let db_path = state
.kv_path
.join(format!("{}", request.package_id))
.join(&request.db);
#[cfg(target_os = "windows")]
let db_path = state.kv_path
.join(format!("{}_{}", request.package_id._package(), request.package_id._publisher()))
let db_path = state
.kv_path
.join(format!(
"{}_{}",
request.package_id._package(),
request.package_id._publisher()
))
.join(&request.db);
fs::remove_dir_all(&db_path).await?;

View File

@ -72,8 +72,13 @@ impl SqliteState {
#[cfg(unix)]
let db_path = self.sqlite_path.join(format!("{package_id}")).join(&db);
#[cfg(target_os = "windows")]
let db_path = self.sqlite_path
.join(format!("{}_{}", package_id._package(), package_id._publisher()))
let db_path = self
.sqlite_path
.join(format!(
"{}_{}",
package_id._package(),
package_id._publisher()
))
.join(&db);
fs::create_dir_all(&db_path).await?;