Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Clean up Debug formatting of meta::Visual #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion symphonia-core/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ pub enum ColorMode {
}

/// A `Visual` is any 2 dimensional graphic.
#[derive(Clone, Debug)]
#[derive(Clone)]
pub struct Visual {
/// The Media Type (MIME Type) used to encode the `Visual`.
pub media_type: String,
Expand All @@ -379,6 +379,20 @@ pub struct Visual {
pub data: Box<[u8]>,
}

impl fmt::Debug for Visual {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Visual")
.field("media_type", &self.media_type)
.field("dimensions", &self.dimensions)
.field("bits_per_pixel", &self.bits_per_pixel)
.field("color_mode", &self.color_mode)
.field("usage", &self.usage)
.field("tags", &self.tags)
.field("data", &format_args!("[u8; {}]", self.data.len()))
.finish()
}
}

/// `VendorData` is any binary metadata that is proprietary to a certain application or vendor.
#[derive(Clone, Debug)]
pub struct VendorData {
Expand Down