servo: Merge #15095 - Omit the 'ServoUrl()' wrapping in ServoUrl's Debug implementation (from servo:debug-servourl); r=nox

Source-Repo: https://github.com/servo/servo
Source-Revision: 0cca7ca85dc611952eeabd5b799e6c933dab7557
This commit is contained in:
Ms2ger 2017-01-18 11:17:05 -08:00
Родитель 731d66d2f4
Коммит 820079fcfc
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -23,7 +23,7 @@ use std::path::Path;
use std::sync::Arc;
use url::{Url, Origin, Position};
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Serialize, Deserialize))]
pub struct ServoUrl(Arc<Url>);
@ -158,6 +158,12 @@ impl fmt::Display for ServoUrl {
}
}
impl fmt::Debug for ServoUrl {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
self.0.fmt(formatter)
}
}
impl Index<RangeFull> for ServoUrl {
type Output = str;
fn index(&self, _: RangeFull) -> &str {