Skip to main content

max / makeover-webview

0.30.1: collapse the nested ifs in the rule walk Three `if cond { if let ... }` pairs, which clippy reads as collapsible and which are clearer as let-chains anyway. No behaviour change; the rule walk produces the same rules.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-12 01:44 UTC
Commit: 38104c40416364878187408de4e9e6ec3f9f72cd
Parent: 90b22ec
2 files changed, +17 insertions, -17 deletions
M Cargo.toml +1 -1
@@ -1,6 +1,6 @@
1 1 [package]
2 2 name = "makeover-webview"
3 - version = "0.30.0"
3 + version = "0.30.1"
4 4 edition = "2024"
5 5 # One copy of this renderer per dependency graph, enforced by cargo rather than
6 6 # by remembering. Two versions means the generated stylesheet and the emitted
M src/vocabulary.rs +16 -16
@@ -179,10 +179,10 @@
179 179 let mut escaped = false;
180 180 // Keep the quotes in the body: a value is not a property name,
181 181 // and dropping them would join two declarations into one.
182 - if blocks.last().copied().unwrap_or(false) {
183 - if let Some((_, body)) = open.last_mut() {
184 - body.push(quote);
185 - }
182 + if blocks.last().copied().unwrap_or(false)
183 + && let Some((_, body)) = open.last_mut()
184 + {
185 + body.push(quote);
186 186 }
187 187 for c in chars.by_ref() {
188 188 if escaped {
@@ -196,10 +196,10 @@
196 196 // The closing quote only. A value holding `;` or `:` would
197 197 // otherwise read as two declarations, and `url("a;b:c")` is a
198 198 // real thing an app writes.
199 - if blocks.last().copied().unwrap_or(false) {
200 - if let Some((_, body)) = open.last_mut() {
201 - body.push(quote);
202 - }
199 + if blocks.last().copied().unwrap_or(false)
200 + && let Some((_, body)) = open.last_mut()
201 + {
202 + body.push(quote);
203 203 }
204 204 }
205 205 '{' => {
@@ -211,18 +211,18 @@
211 211 prelude.clear();
212 212 }
213 213 '}' => {
214 - if blocks.pop().unwrap_or(false) {
215 - if let Some(rule) = open.pop() {
216 - out.push(rule);
217 - }
214 + if blocks.pop().unwrap_or(false)
215 + && let Some(rule) = open.pop()
216 + {
217 + out.push(rule);
218 218 }
219 219 prelude.clear();
220 220 }
221 221 _ => {
222 - if blocks.last().copied().unwrap_or(false) {
223 - if let Some((_, body)) = open.last_mut() {
224 - body.push(c);
225 - }
222 + if blocks.last().copied().unwrap_or(false)
223 + && let Some((_, body)) = open.last_mut()
224 + {
225 + body.push(c);
226 226 } else if c == ';' {
227 227 prelude.clear();
228 228 } else {