From 8673aea5d0694d22e1d823550ed02bf98f016c14 Mon Sep 17 00:00:00 2001 From: Rua Date: Thu, 15 Feb 2024 16:39:02 +0100 Subject: [PATCH] Fix Rust 1.76 clippy warnings (#2462) * Fix Rust 1.76 clippy warnings * Fix doctest error --- examples/deferred/frame/system.rs | 9 ++++----- vulkano-util/src/window.rs | 3 +-- vulkano/src/command_buffer/commands/query.rs | 2 +- vulkano/src/query.rs | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/deferred/frame/system.rs b/examples/deferred/frame/system.rs index c9359e37..299e594b 100644 --- a/examples/deferred/frame/system.rs +++ b/examples/deferred/frame/system.rs @@ -408,11 +408,10 @@ impl<'a> Frame<'a> { pub fn next_pass<'f>(&'f mut self) -> Option> { // This function reads `num_pass` increments its value, and returns a struct corresponding // to that pass that the user will be able to manipulate in order to customize the pass. - match { - let current_pass = self.num_pass; - self.num_pass += 1; - current_pass - } { + let current_pass = self.num_pass; + self.num_pass += 1; + + match current_pass { 0 => { // If we are in the pass 0 then we haven't start anything yet. // We already called `begin_render_pass` (in the `frame()` method), and that's the diff --git a/vulkano-util/src/window.rs b/vulkano-util/src/window.rs index 60b85578..338eccf5 100644 --- a/vulkano-util/src/window.rs +++ b/vulkano-util/src/window.rs @@ -23,10 +23,9 @@ use winit::{ /// }; /// use winit::event_loop::EventLoop; /// -/// #[test] /// fn test() { /// let context = VulkanoContext::new(VulkanoConfig::default()); -/// let event_loop = EventLoop::new(); +/// let event_loop = EventLoop::new().unwrap(); /// let mut vulkano_windows = VulkanoWindows::default(); /// let _id1 = /// vulkano_windows.create_window(&event_loop, &context, &Default::default(), |_| {}); diff --git a/vulkano/src/command_buffer/commands/query.rs b/vulkano/src/command_buffer/commands/query.rs index de7a6690..a64f9ef3 100644 --- a/vulkano/src/command_buffer/commands/query.rs +++ b/vulkano/src/command_buffer/commands/query.rs @@ -251,7 +251,7 @@ impl RecordingCommandBuffer { /// /// See also [`get_results`]. /// - /// [`query_pool.ty().result_len()`]: crate::query::QueryType::result_len + /// [`query_pool.ty().result_len()`]: crate::query::QueryPool::result_len /// [`QueryResultFlags::WITH_AVAILABILITY`]: crate::query::QueryResultFlags::WITH_AVAILABILITY /// [`get_results`]: crate::query::QueryPool::get_results pub fn copy_query_pool_results( diff --git a/vulkano/src/query.rs b/vulkano/src/query.rs index 079100de..88056602 100644 --- a/vulkano/src/query.rs +++ b/vulkano/src/query.rs @@ -168,7 +168,7 @@ impl QueryPool { /// /// See also [`copy_query_pool_results`]. /// - /// [`self.ty().result_len()`]: QueryType::result_len + /// [`self.ty().result_len()`]: QueryPool::result_len /// [`WITH_AVAILABILITY`]: QueryResultFlags::WITH_AVAILABILITY /// [`copy_query_pool_results`]: crate::command_buffer::RecordingCommandBuffer::copy_query_pool_results #[inline]