pattern: shorten code

It also more consistent with similar code in gradient.rs
3 jobs for cleanups in 8 minutes and 24 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #149486
fedora test

00:07:56

 
  Lint
manual #149488
allowed to fail manual
clippy
passed #149487
rustfmt

00:00:28