Skip to content

Commit

Permalink
style(naga): delimit error's items with two newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed May 13, 2024
1 parent 8879733 commit ac2058b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions naga/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl fmt::Display for ShaderError<crate::front::wgsl::ParseError> {
write!(f, "\nShader '{label}' parsing {string}")
}
}

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

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

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

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

0 comments on commit ac2058b

Please sign in to comment.