diff --git a/librashader-runtime-gl/src/binding.rs b/librashader-runtime-gl/src/binding.rs index 4045ac2..40eaad3 100644 --- a/librashader-runtime-gl/src/binding.rs +++ b/librashader-runtime-gl/src/binding.rs @@ -69,8 +69,9 @@ where location: VariableLocation, _: &(), ) -> Option<()> { - if let Some(location) = location.location(block) - && location.bindable() + if let Some(location) = location + .location(block) + .filter(|location| location.bindable()) { if location.is_valid(BindingStage::VERTEX) { unsafe { @@ -96,8 +97,9 @@ impl BindUniform for GlUniformBinder { location: VariableLocation, _: &(), ) -> Option<()> { - if let Some(location) = location.location(block) - && location.bindable() + if let Some(location) = location + .location(block) + .filter(|location| location.bindable()) { unsafe { if location.is_valid(BindingStage::VERTEX) { @@ -121,8 +123,9 @@ impl BindUniform for GlUniformBinder { location: VariableLocation, _: &(), ) -> Option<()> { - if let Some(location) = location.location(block) - && location.bindable() + if let Some(location) = location + .location(block) + .filter(|location| location.bindable()) { unsafe { if location.is_valid(BindingStage::VERTEX) { diff --git a/librashader-runtime-gl/src/filter_chain/mod.rs b/librashader-runtime-gl/src/filter_chain/mod.rs index bfa7407..2d9b38c 100644 --- a/librashader-runtime-gl/src/filter_chain/mod.rs +++ b/librashader-runtime-gl/src/filter_chain/mod.rs @@ -28,12 +28,10 @@ impl FilterChainGL { options: Option<&FilterChainOptionsGL>, ) -> Result { let result = catch_unwind(|| { - if let Some(options) = options - && options.use_dsa - { + if options.is_some_and(|options| options.use_dsa) { return Ok(Self { filter: FilterChainDispatch::DirectStateAccess(unsafe { - FilterChainImpl::load_from_preset(preset, Some(options))? + FilterChainImpl::load_from_preset(preset, options)? }), }); } diff --git a/librashader-runtime-gl/src/lib.rs b/librashader-runtime-gl/src/lib.rs index 5bba053..72313ce 100644 --- a/librashader-runtime-gl/src/lib.rs +++ b/librashader-runtime-gl/src/lib.rs @@ -3,7 +3,6 @@ //! This crate should not be used directly. //! See [`librashader::runtime::gl`](https://docs.rs/librashader/latest/librashader/runtime/gl/index.html) instead. #![deny(unsafe_op_in_unsafe_fn)] -#![feature(let_chains)] #![feature(type_alias_impl_trait)] mod binding;