summaryrefslogtreecommitdiff
path: root/opengl-bindings/src/framebuffer.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-09-22 14:40:53 +0200
committerHampusM <hampus@hampusmat.com>2026-09-22 14:40:53 +0200
commit0653c41f12a6e5bed35723b401c5b4d9505059bf (patch)
tree5a01db514c9c9e9d841e1252fe99d6e1016e3d53 /opengl-bindings/src/framebuffer.rs
parent6ccfd7833272638953a2b3548f30ec0a6f3149de (diff)
refactor(opengl-bindings): fix clippy lints
Diffstat (limited to 'opengl-bindings/src/framebuffer.rs')
-rw-r--r--opengl-bindings/src/framebuffer.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/opengl-bindings/src/framebuffer.rs b/opengl-bindings/src/framebuffer.rs
index a758cc3..5b85f65 100644
--- a/opengl-bindings/src/framebuffer.rs
+++ b/opengl-bindings/src/framebuffer.rs
@@ -74,9 +74,7 @@ impl Framebuffer
unsafe {
current_context.fns().NamedFramebufferDrawBuffer(
self.inner,
- buffer
- .map(ColorAttachment::into_gl)
- .unwrap_or(crate::sys::NONE),
+ buffer.map_or(crate::sys::NONE, ColorAttachment::into_gl),
);
}
}
@@ -91,11 +89,13 @@ impl Framebuffer
}
}
+ #[must_use]
pub fn from_raw(raw: u32) -> Self
{
Self { inner: raw }
}
+ #[must_use]
pub fn into_raw(self) -> u32
{
self.inner
@@ -116,9 +116,7 @@ pub fn bind(
unsafe {
current_context.fns().BindFramebuffer(
target.into_gl(),
- framebuffer
- .map(|framebuffer| framebuffer.inner)
- .unwrap_or(0),
+ framebuffer.map_or(0, |framebuffer| framebuffer.inner),
);
}
}