Skip to content

Commit

Permalink
Run rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Dec 12, 2023
1 parent 7c46fd2 commit 52d389b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions crates/portal-wormhole/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ const TRANSFER_REJECTED_MESSAGE: &str = "transfer rejected";

impl From<TransferError> for PortalError {
fn from(value: TransferError) -> Self {
if let TransferError::PeerError(ref message) = value && message == TRANSFER_REJECTED_MESSAGE {
if let TransferError::PeerError(ref message) = value
&& message == TRANSFER_REJECTED_MESSAGE
{
PortalError::TransferRejected(value)
}
else {
} else {
PortalError::WormholeTransfer(value)
}
}
Expand Down
4 changes: 3 additions & 1 deletion crates/portal-wormhole/src/fs/filename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ fn replace_consecutive<'a>(
replacement: &'a str,
) {
let mut index = 0;
while index < haystack.len() && let Some(range) = next_match(&haystack[index..], &mut pattern) {
while index < haystack.len()
&& let Some(range) = next_match(&haystack[index..], &mut pattern)
{
let absolute_range = (index + range.start)..(index + range.end);
haystack.to_mut().replace_range(absolute_range, replacement);
index += range.end;
Expand Down

0 comments on commit 52d389b

Please sign in to comment.