diff --git a/crates/portal-wormhole/src/error.rs b/crates/portal-wormhole/src/error.rs index 9d9b071..5dfcd3d 100644 --- a/crates/portal-wormhole/src/error.rs +++ b/crates/portal-wormhole/src/error.rs @@ -26,10 +26,11 @@ const TRANSFER_REJECTED_MESSAGE: &str = "transfer rejected"; impl From 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) } } diff --git a/crates/portal-wormhole/src/fs/filename.rs b/crates/portal-wormhole/src/fs/filename.rs index 660850f..65de7c1 100644 --- a/crates/portal-wormhole/src/fs/filename.rs +++ b/crates/portal-wormhole/src/fs/filename.rs @@ -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;