Skip to content

Commit f830c0d

Browse files
committed
fix fmt
1 parent 6b79331 commit f830c0d

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

server/src/banner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn status_info(config: &Config, scheme: &str, id: Uid) {
7171
eprintln!(
7272
"
7373
Welcome to Parseable Server! Deployment UID: \"{}\"",
74-
id.to_string(),
74+
id.to_string(),
7575
);
7676

7777
eprintln!(

server/src/localcache.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use std::{io, path::PathBuf};
2121
use fs_extra::file::CopyOptions;
2222
use futures_util::TryFutureExt;
2323
use hashlru::Cache;
24+
use human_size::{Byte, Gigibyte, SpecificSize};
2425
use itertools::{Either, Itertools};
2526
use object_store::{local::LocalFileSystem, ObjectStore};
2627
use once_cell::sync::OnceCell;
2728
use tokio::{fs, sync::Mutex};
28-
use human_size::{SpecificSize, Gigibyte, Byte};
2929

3030
use crate::option::CONFIG;
3131

@@ -100,7 +100,7 @@ impl LocalCacheManager {
100100
pub async fn validate(&self, config_capacity: u64) -> Result<(), CacheError> {
101101
fs::create_dir_all(&self.cache_path).await?;
102102
let path = cache_meta_path(&self.cache_path)
103-
.map_err(|err| CacheError::ObjectStoreError(err.into()))?;
103+
.map_err(|err| CacheError::ObjectStoreError(err.into()))?;
104104
let resp = self
105105
.filesystem
106106
.get(&path)
@@ -112,8 +112,14 @@ impl LocalCacheManager {
112112
let mut meta: CacheMeta = serde_json::from_slice(&bytes)?;
113113
if meta.size_capacity != config_capacity {
114114
// log the change in cache size
115-
let configured_size_human: SpecificSize<Gigibyte> = SpecificSize::new(config_capacity as f64, Byte).unwrap().into();
116-
let current_size_human: SpecificSize<Gigibyte> = SpecificSize::new(meta.size_capacity as f64, Byte).unwrap().into();
115+
let configured_size_human: SpecificSize<Gigibyte> =
116+
SpecificSize::new(config_capacity as f64, Byte)
117+
.unwrap()
118+
.into();
119+
let current_size_human: SpecificSize<Gigibyte> =
120+
SpecificSize::new(meta.size_capacity as f64, Byte)
121+
.unwrap()
122+
.into();
117123
log::warn!(
118124
"Cache size is updated from {} to {}",
119125
current_size_human,

server/src/option.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@ pub mod validation {
609609
str::FromStr,
610610
};
611611

612-
use human_size::{SpecificSize,multiples};
613612
use crate::option::MIN_CACHE_SIZE_BYTES;
614613
use crate::storage::LOCAL_SYNC_INTERVAL;
614+
use human_size::{multiples, SpecificSize};
615615

616616
pub fn file_path(s: &str) -> Result<PathBuf, String> {
617617
if s.is_empty() {
@@ -684,7 +684,9 @@ pub mod validation {
684684
}
685685

686686
pub fn upload_interval(s: &str) -> Result<u64, String> {
687-
let u = s.parse::<u64>().map_err(|_| "invalid upload interval".to_string())?;
687+
let u = s
688+
.parse::<u64>()
689+
.map_err(|_| "invalid upload interval".to_string())?;
688690
if u < LOCAL_SYNC_INTERVAL {
689691
return Err("object storage upload interval must be 60 seconds or more".to_string());
690692
}

0 commit comments

Comments
 (0)