зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1897774 - Implement Debug for HeaderSlice manually. r=firefox-style-system-reviewers,tlouw
Otherwise it doesn't show what the slice contains, which makes restyle logs a bit useless. Differential Revision: https://phabricator.services.mozilla.com/D210929
This commit is contained in:
Родитель
a955258af0
Коммит
0d680476b7
|
@ -682,7 +682,7 @@ impl<T: Serialize> Serialize for Arc<T> {
|
|||
///
|
||||
/// cbindgen:derive-eq=false
|
||||
/// cbindgen:derive-neq=false
|
||||
#[derive(Debug, Eq)]
|
||||
#[derive(Eq)]
|
||||
#[repr(C)]
|
||||
pub struct HeaderSlice<H, T> {
|
||||
/// The fixed-sized data.
|
||||
|
@ -713,6 +713,15 @@ impl<H, T> Drop for HeaderSlice<H, T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<H: fmt::Debug, T: fmt::Debug> fmt::Debug for HeaderSlice<H, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("HeaderSlice")
|
||||
.field("header", &self.header)
|
||||
.field("slice", &self.slice())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl<H, T> HeaderSlice<H, T> {
|
||||
/// Returns the dynamically sized slice in this HeaderSlice.
|
||||
#[inline(always)]
|
||||
|
|
Загрузка…
Ссылка в новой задаче