Skip to content

Commit

Permalink
Short debug format for empty Envelopes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 7, 2024
1 parent 38a322f commit 3e3287a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions libsignal-service/src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,24 @@ impl<S, R> fmt::Debug for ServiceCipher<S, R> {
}

fn debug_envelope(envelope: &Envelope) -> String {
format!(
"Envelope {{ \
if envelope.content.is_none() {
"Envelope { empty }".to_string()
} else {
format!(
"Envelope {{ \
source_address: {:?}, \
source_device: {:?}, \
server_guid: {:?}, \
timestamp: {:?}, \
content: {} bytes, \
}}",
envelope.source_address(),
envelope.source_device(),
envelope.server_guid(),
envelope.timestamp(),
envelope.content().len(),
)
envelope.source_address(),
envelope.source_device(),
envelope.server_guid(),
envelope.timestamp(),
envelope.content().len(),
)
}
}

impl<S, R> ServiceCipher<S, R>
Expand Down

0 comments on commit 3e3287a

Please sign in to comment.