Fix #87: rust-version is 1.95, and clippy 1.95 passes

egui 0.36 needs rustc 1.95 (hayro and krilla 1.92), so the declared 1.90 let
cargo fail on dependency versions instead of naming the toolchain. Clippy 1.95
also flagged four collapsible matches that newer clippy no longer does; each is
rewritten without changing behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic 2026-10-05 23:05:32 +07:00
parent 63bf2c4598
commit 885b7acac1
5 changed files with 13 additions and 16 deletions

View File

@ -7,7 +7,7 @@ default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtas
version = "0.3.0" version = "0.3.0"
edition = "2024" edition = "2024"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
rust-version = "1.90" rust-version = "1.95"
repository = "https://github.com/storytold/vectorcraft" repository = "https://github.com/storytold/vectorcraft"
[workspace.dependencies] [workspace.dependencies]

View File

@ -757,11 +757,7 @@ fn clean_up(s: &mut Session, p: &Value) -> Result<Value> {
visit(c, true, false, false, v, opts); visit(c, true, false, false, v, opts);
} }
} }
NodeKind::Text(t) => { NodeKind::Text(t) if empty_text && t.plain_text().trim().is_empty() => v.push(n.id),
if empty_text && t.plain_text().trim().is_empty() {
v.push(n.id);
}
}
NodeKind::Layer { children, .. } => { NodeKind::Layer { children, .. } => {
for c in children { for c in children {
visit(c, false, false, false, v, opts); visit(c, false, false, false, v, opts);

View File

@ -97,7 +97,9 @@ fn sync(app: &VectorcraftApp, d: &mut Dialog) {
let preset = d.str("preset"); let preset = d.str("preset");
match d.fields.get(APPLIED).and_then(Value::as_object) { match d.fields.get(APPLIED).and_then(Value::as_object) {
Some(a) if a.get("preset").and_then(Value::as_str) == Some(preset.as_str()) => { Some(a) if a.get("preset").and_then(Value::as_str) == Some(preset.as_str()) => {
if a.iter().any(|(k, v)| k != "preset" && d.fields.get(k) != Some(v)) { // Unchanged fields keep the preset (falling through would apply it again).
let edited = a.iter().any(|(k, v)| k != "preset" && d.fields.get(k) != Some(v));
if edited {
d.fields.insert("preset".into(), json!("")); d.fields.insert("preset".into(), json!(""));
d.fields.remove(APPLIED); d.fields.remove(APPLIED);
} }

View File

@ -2383,14 +2383,13 @@ mod tests {
fn walk(items: &[Item], bad: &mut Vec<String>) { fn walk(items: &[Item], bad: &mut Vec<String>) {
for it in items { for it in items {
match it { match it {
Item::Cmd(_, id, _) => { Item::Cmd(_, id, _)
if vectorcraft_engine::find_command(id).is_none() if vectorcraft_engine::find_command(id).is_none()
&& !UI_COMMANDS.iter().any(|c| c.0 == *id) && !UI_COMMANDS.iter().any(|c| c.0 == *id)
&& !id.starts_with("object.path.") && !id.starts_with("object.path.")
&& *id != "type.createOutlines" && *id != "type.createOutlines" =>
{ {
bad.push(id.to_string()); bad.push(id.to_string());
}
} }
Item::Sub(_, ch) => walk(ch, bad), Item::Sub(_, ch) => walk(ch, bad),
_ => {} _ => {}

View File

@ -177,11 +177,11 @@ pub fn check(crates: &[Crate]) -> Vec<Violation> {
match classify(&d.name) { match classify(&d.name) {
// Unregistered deps are reported on their own entry. // Unregistered deps are reported on their own entry.
None => {} None => {}
Some(Class::Testkit) => { Some(Class::Testkit) if d.kind != DepKind::Dev => {
if d.kind != DepKind::Dev { out.push(Violation::TestkitAsNormalDep { krate: c.name.clone() });
out.push(Violation::TestkitAsNormalDep { krate: c.name.clone() });
}
} }
// The testkit as a dev-dependency is how tests use it.
Some(Class::Testkit) => {}
Some(dc) => { Some(dc) => {
let to = dc.layer().unwrap_or(u8::MAX); let to = dc.layer().unwrap_or(u8::MAX);
if to >= layer && !(to == layer && intra_layer_allowed(&c.name, &d.name)) { if to >= layer && !(to == layer && intra_layer_allowed(&c.name, &d.name)) {