mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add useful debug output for HTTP response and image cache.
This commit is contained in:
parent
734cf9e1b3
commit
a241232c2b
4 changed files with 9 additions and 1 deletions
|
@ -180,7 +180,8 @@ impl fmt::Display for ServoUrl {
|
|||
impl fmt::Debug for ServoUrl {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
if self.0.as_str().len() > 40 {
|
||||
let hasher = DefaultHasher::new();
|
||||
let mut hasher = DefaultHasher::new();
|
||||
hasher.write(self.0.as_str().as_bytes());
|
||||
let truncated: String = self.0.as_str().chars().take(40).collect();
|
||||
let result = format!("{}... ({:x})", truncated, hasher.finish());
|
||||
return result.fmt(formatter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue