Merge pull request #144 from storytold/fix/issue-87-rust-version

Fix #87: rust-version 1.95 and clippy 1.95
This commit is contained in:
BFlat 2026-10-05 23:05:47 +07:00 committed by GitHub
commit 088ffc844b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.90"
rust-version = "1.95"
repository = "https://github.com/storytold/vectorcraft"
[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);
}
}
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);

View File

@ -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);
}

View File

@ -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),
_ => {}

View File

@ -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)) {