Skip to content

Commit

Permalink
Merge pull request #538 from zahash/surface_format
Browse files Browse the repository at this point in the history
use find() instead of filter().next()
  • Loading branch information
sotrh authored May 18, 2024
2 parents 35af1c5 + 8e180c0 commit 30a9f02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/beginner/tutorial2-surface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,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()
.find(|f| f.is_srgb())
.copied()
.filter(|f| f.is_srgb())
.next()
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
Expand Down

0 comments on commit 30a9f02

Please sign in to comment.