mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 00:21:38 +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
|
// this merely describes whether our provider is available to other nodes
|
||||||
// and if so, which nodes are allowed to access it (public/whitelist/blacklist)
|
// and if so, which nodes are allowed to access it (public/whitelist/blacklist)
|
||||||
let access_settings: AccessSettings =
|
let access_settings: AccessSettings =
|
||||||
match tokio::fs::read_to_string(home_directory_path.join(".eth_access_settings"))
|
match tokio::fs::read_to_string(home_directory_path.join(".eth_access_settings")).await {
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(contents) => serde_json::from_str(&contents).unwrap(),
|
Ok(contents) => serde_json::from_str(&contents).unwrap(),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
let access_settings = AccessSettings {
|
let access_settings = AccessSettings {
|
||||||
|
@ -64,11 +64,15 @@ impl KvState {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let db_path = self.kv_path.join(format!("{package_id}")).join(&db);
|
let db_path = self.kv_path.join(format!("{package_id}")).join(&db);
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let db_path = self.kv_path
|
let db_path = self
|
||||||
.join(format!("{}_{}", package_id._package(), package_id._publisher()))
|
.kv_path
|
||||||
|
.join(format!(
|
||||||
|
"{}_{}",
|
||||||
|
package_id._package(),
|
||||||
|
package_id._publisher()
|
||||||
|
))
|
||||||
.join(&db);
|
.join(&db);
|
||||||
|
|
||||||
|
|
||||||
fs::create_dir_all(&db_path).await?;
|
fs::create_dir_all(&db_path).await?;
|
||||||
|
|
||||||
self.open_kvs.insert(
|
self.open_kvs.insert(
|
||||||
@ -509,12 +513,18 @@ async fn check_caps(
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let db_path = state.kv_path
|
let db_path = state
|
||||||
|
.kv_path
|
||||||
.join(format!("{}", request.package_id))
|
.join(format!("{}", request.package_id))
|
||||||
.join(&request.db);
|
.join(&request.db);
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let db_path = state.kv_path
|
let db_path = state
|
||||||
.join(format!("{}_{}", request.package_id._package(), request.package_id._publisher()))
|
.kv_path
|
||||||
|
.join(format!(
|
||||||
|
"{}_{}",
|
||||||
|
request.package_id._package(),
|
||||||
|
request.package_id._publisher()
|
||||||
|
))
|
||||||
.join(&request.db);
|
.join(&request.db);
|
||||||
|
|
||||||
fs::remove_dir_all(&db_path).await?;
|
fs::remove_dir_all(&db_path).await?;
|
||||||
|
@ -72,8 +72,13 @@ impl SqliteState {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let db_path = self.sqlite_path.join(format!("{package_id}")).join(&db);
|
let db_path = self.sqlite_path.join(format!("{package_id}")).join(&db);
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let db_path = self.sqlite_path
|
let db_path = self
|
||||||
.join(format!("{}_{}", package_id._package(), package_id._publisher()))
|
.sqlite_path
|
||||||
|
.join(format!(
|
||||||
|
"{}_{}",
|
||||||
|
package_id._package(),
|
||||||
|
package_id._publisher()
|
||||||
|
))
|
||||||
.join(&db);
|
.join(&db);
|
||||||
|
|
||||||
fs::create_dir_all(&db_path).await?;
|
fs::create_dir_all(&db_path).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user