From 8e180c0fb2f434e9abecf023627425ec298d025f Mon Sep 17 00:00:00 2001 From: zahash Date: Sat, 2 Mar 2024 17:36:48 +0530 Subject: [PATCH] put copied() after find() to avoid unnecessary copying of all the traversed items and instead copy only the one found --- docs/beginner/tutorial2-surface/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index c087ff55..024b89f2 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -161,8 +161,8 @@ The `limits` field describes the limit of certain types of resources that we can // one will result in all the colors coming out darker. If you want to support non // sRGB surfaces, you'll need to account for that when drawing to the frame. let surface_format = surface_caps.formats.iter() - .copied() .find(|f| f.is_srgb()) + .copied() .unwrap_or(surface_caps.formats[0]); let config = wgpu::SurfaceConfiguration { usage: wgpu::TextureUsages::RENDER_ATTACHMENT,