aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-11 11:52:57 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-11 11:52:57 +0200
commitde5d7921813ad84038053c96004ce617bc144722 (patch)
tree057069ecc6acc051dad97f7c62a62ede312b52ba /src/block
parentbe91ef6294bcc699f075746fd3abb57a9b22e838 (diff)
downloadgarage-de5d7921813ad84038053c96004ce617bc144722.tar.gz
garage-de5d7921813ad84038053c96004ce617bc144722.zip
block manager: fix indentation (why not detected by cargo fmt?)
Diffstat (limited to 'src/block')
-rw-r--r--src/block/layout.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/block/layout.rs b/src/block/layout.rs
index 1d8f4cda..e8339405 100644
--- a/src/block/layout.rs
+++ b/src/block/layout.rs
@@ -287,22 +287,22 @@ fn make_data_dirs(dirs: &DataDirEnum) -> Result<Vec<DataDir>, Error> {
let mut ok = false;
for dir in dirs.iter() {
let state = match &dir.capacity {
- Some(cap) if dir.read_only == false => {
- let capacity = cap.parse::<bytesize::ByteSize>()
- .ok_or_message("invalid capacity value")?.as_u64();
- if capacity == 0 {
- return Err(Error::Message(format!("data directory {} should have non-zero capacity", dir.path.to_string_lossy())));
- }
- ok = true;
- DataDirState::Active {
- capacity,
- }
- }
- None if dir.read_only == true => {
- DataDirState::ReadOnly
- }
- _ => return Err(Error::Message(format!("data directories in data_dir should have a capacity value or be marked read_only, not the case for {}", dir.path.to_string_lossy()))),
- };
+ Some(cap) if dir.read_only == false => {
+ let capacity = cap.parse::<bytesize::ByteSize>()
+ .ok_or_message("invalid capacity value")?.as_u64();
+ if capacity == 0 {
+ return Err(Error::Message(format!("data directory {} should have non-zero capacity", dir.path.to_string_lossy())));
+ }
+ ok = true;
+ DataDirState::Active {
+ capacity,
+ }
+ }
+ None if dir.read_only == true => {
+ DataDirState::ReadOnly
+ }
+ _ => return Err(Error::Message(format!("data directories in data_dir should have a capacity value or be marked read_only, not the case for {}", dir.path.to_string_lossy()))),
+ };
data_dirs.push(DataDir {
path: dir.path.clone(),
state,