Skip to content

Commit

Permalink
chore: reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Sep 19, 2023
1 parent 0add7bf commit 60a88ad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
8 changes: 6 additions & 2 deletions rsync-core/src/redis_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ pub async fn follow_symlink(
}
}
ComponentOwned::Normal(name) => {
let Some(entry): Option<Metadata> = conn.hget(redis_index, cwd.join(&name).as_os_str().as_bytes()).await? else {
let Some(entry): Option<Metadata> = conn
.hget(redis_index, cwd.join(&name).as_os_str().as_bytes())
.await?
else {
warn!(?cwd, ?name, "broken symlink");
return Ok(None);
};
Expand Down Expand Up @@ -506,7 +509,8 @@ async fn follow_direct_link(

let Some(new_meta) = conn
.hget(redis_index, new_loc.as_os_str().as_bytes())
.await? else {
.await?
else {
break None;
};

Expand Down
4 changes: 3 additions & 1 deletion rsync-fetcher/src/rsync/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ impl Downloader {
debug!("basis generator started");

for item in transfer_plan {
let Some(blake2b_hash) = &item.blake2b else { continue; };
let Some(blake2b_hash) = &item.blake2b else {
continue;
};

let entry = &self.file_list[item.idx as usize];
if ignore_mode(entry.mode, None::<()>) {
Expand Down
8 changes: 6 additions & 2 deletions rsync-gateway/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ pub async fn main_handler(

let namespace = &endpoint.namespace;
let s3_prefix = &endpoint.s3_prefix;
let Some(Revision { revision, generated_at }) = state.revision() else {
let Some(Revision {
revision,
generated_at,
}) = state.revision()
else {
return Either::Left(render_internal_error(
&req_path,
prefix,
Expand All @@ -72,7 +76,7 @@ pub async fn main_handler(
Duration::default(),
&eyre!("no revision available"),
&request_id,
locale
locale,
));
};

Expand Down
8 changes: 4 additions & 4 deletions rsync-gateway/src/realpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ pub async fn realpath<'a>(
let next = resolved.join(name);
let Some(entry) =
entry_of_path(revision, next.as_os_str().as_bytes(), &mut *conn).await?
else {
explain!(resolved, next_comp, "not found, abort", explain);
giveup!(Broken, path, explain);
};
else {
explain!(resolved, next_comp, "not found, abort", explain);
giveup!(Broken, path, explain);
};
match entry {
Entry::Regular { blake2b } => {
if !left.is_empty() {
Expand Down

0 comments on commit 60a88ad

Please sign in to comment.