mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 08:01:47 +03:00
Format Rust code using rustfmt
This commit is contained in:
parent
a27de55882
commit
4727de6f03
@ -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 {
|
||||
|
@ -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?;
|
||||
|
@ -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?;
|
||||
|
Loading…
Reference in New Issue
Block a user