Skip to content

Commit eb3cd24

Browse files
Fix Debug impl for opaque Shader type
1 parent d2e5f38 commit eb3cd24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/graphics/shader.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,18 @@ use {
132132
/// [`Text`]: crate::graphics::Text
133133
/// [`RenderTexture`]: crate::graphics::RenderTexture
134134
///
135-
#[derive(Debug)]
136135
#[repr(C)]
137136
pub struct Shader<'texture> {
138137
_opaque: [u8; 0],
139138
_texture: PhantomData<&'texture Texture>,
140139
}
141140

141+
impl std::fmt::Debug for Shader<'_> {
142+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
143+
write!(f, "Shader(<opaque> @ {self:p})")
144+
}
145+
}
146+
142147
impl<'texture> Shader<'texture> {
143148
fn new() -> SfResult<FBox<Self>> {
144149
FBox::new(unsafe { ffi::sfShader_new() }.cast()).into_sf_result()

0 commit comments

Comments
 (0)