Skip to content

Commit

Permalink
style(core): delimit pipeline's items with two newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 26, 2024
1 parent e2e9ef5 commit 1c6c7ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wgpu-core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub struct ShaderError<E> {
pub label: Option<String>,
pub inner: Box<E>,
}

#[cfg(feature = "wgsl")]
impl fmt::Display for ShaderError<naga::front::wgsl::ParseError> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -107,6 +108,7 @@ impl fmt::Display for ShaderError<naga::front::wgsl::ParseError> {
write!(f, "\nShader '{label}' parsing {string}")
}
}

#[cfg(feature = "glsl")]
impl fmt::Display for ShaderError<naga::front::glsl::ParseError> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -123,6 +125,7 @@ impl fmt::Display for ShaderError<naga::front::spv::Error> {
write!(f, "\nShader '{label}' parsing {string}")
}
}

impl fmt::Display for ShaderError<naga::WithSpan<naga::valid::ValidationError>> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use codespan_reporting::{
Expand Down Expand Up @@ -154,6 +157,7 @@ impl fmt::Display for ShaderError<naga::WithSpan<naga::valid::ValidationError>>
)
}
}

impl<E> Error for ShaderError<E>
where
ShaderError<E>: fmt::Display,
Expand Down

0 comments on commit 1c6c7ed

Please sign in to comment.