mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
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 <[email protected]>
This commit is contained in:
1 parent
63bf2c4598
commit
885b7acac1
5 files changed
+13
-16
No files matched your search
+1
-1
@@ -7,7 +7,7 @@ default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtas
|
||||
version = "0.3.0"
|
||||
edition = "2024"
|
||||
license = "MIT OR Apache-2.0"
|
||||
rust-version = "1.90"
|
||||
rust-version = "1.95"
|
||||
repository = "https://github.com/storytold/vectorcraft"
|
||||
|
||||
[workspace.dependencies]
|
||||
|
||||
@@ -757,11 +757,7 @@ fn clean_up(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
visit(c, true, false, false, v, opts);
|
||||
}
|
||||
}
|
||||
NodeKind::Text(t) => {
|
||||
if empty_text && t.plain_text().trim().is_empty() {
|
||||
v.push(n.id);
|
||||
}
|
||||
}
|
||||
NodeKind::Text(t) if empty_text && t.plain_text().trim().is_empty() => v.push(n.id),
|
||||
NodeKind::Layer { children, .. } => {
|
||||
for c in children {
|
||||
visit(c, false, false, false, v, opts);
|
||||
|
||||
@@ -97,7 +97,9 @@ fn sync(app: &VectorcraftApp, d: &mut Dialog) {
|
||||
let preset = d.str("preset");
|
||||
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()) => {
|
||||
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.remove(APPLIED);
|
||||
}
|
||||
|
||||
@@ -2383,14 +2383,13 @@ mod tests {
|
||||
fn walk(items: &[Item], bad: &mut Vec<String>) {
|
||||
for it in items {
|
||||
match it {
|
||||
Item::Cmd(_, id, _) => {
|
||||
Item::Cmd(_, id, _)
|
||||
if vectorcraft_engine::find_command(id).is_none()
|
||||
&& !UI_COMMANDS.iter().any(|c| c.0 == *id)
|
||||
&& !id.starts_with("object.path.")
|
||||
&& *id != "type.createOutlines"
|
||||
{
|
||||
bad.push(id.to_string());
|
||||
}
|
||||
&& *id != "type.createOutlines" =>
|
||||
{
|
||||
bad.push(id.to_string());
|
||||
}
|
||||
Item::Sub(_, ch) => walk(ch, bad),
|
||||
_ => {}
|
||||
|
||||
+4
-4
@@ -177,11 +177,11 @@ pub fn check(crates: &[Crate]) -> Vec<Violation> {
|
||||
match classify(&d.name) {
|
||||
// Unregistered deps are reported on their own entry.
|
||||
None => {}
|
||||
Some(Class::Testkit) => {
|
||||
if d.kind != DepKind::Dev {
|
||||
out.push(Violation::TestkitAsNormalDep { krate: c.name.clone() });
|
||||
}
|
||||
Some(Class::Testkit) if d.kind != DepKind::Dev => {
|
||||
out.push(Violation::TestkitAsNormalDep { krate: c.name.clone() });
|
||||
}
|
||||
// The testkit as a dev-dependency is how tests use it.
|
||||
Some(Class::Testkit) => {}
|
||||
Some(dc) => {
|
||||
let to = dc.layer().unwrap_or(u8::MAX);
|
||||
if to >= layer && !(to == layer && intra_layer_allowed(&c.name, &d.name)) {
|
||||
|
||||
Reference in new issue
Block a user