From 8260e137ded22ca7981accfaf0b0473047929d37 Mon Sep 17 00:00:00 2001 From: harehare Date: Fri, 17 Apr 2026 21:28:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=A6=20build(deps):=20update=20Rust?= =?UTF-8?q?=20toolchain=20to=201.95.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Rust version from 1.94.1 to 1.95.0 in both Dockerfile and rust-toolchain.toml. --- Dockerfile | 3 +-- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 399795b54..0580aad8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM rust:1.94.1-slim@sha256:f1a887e70d5bb8773c3248c096ae296d7e5618dc41b51685a7759d6dc9ed0551 AS builder +FROM rust:1.95.0-slim@sha256:275c320a57d0d8b6ab09454ab6d1660d70c745fb3cc85adbefad881b69a212cc AS builder WORKDIR /usr/src/app COPY . /usr/src/app @@ -11,4 +11,3 @@ FROM gcr.io/distroless/cc:nonroot COPY --from=builder --chown=nonroot:nonroot /usr/src/app/target/release/mq /usr/local/bin/mq ENTRYPOINT [ "mq" ] - diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2f9fdbadd..f92020c65 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.94.1" +channel = "1.95.0" profile = "default" From f069f26d433e68d37d2bdc7872be7d1a4d03bfd9 Mon Sep 17 00:00:00 2001 From: harehare Date: Fri, 17 Apr 2026 21:43:49 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=A8=20fix:=20improve=20division=20?= =?UTF-8?q?handling=20and=20simplify=20match=20conditions=20in=20type=20un?= =?UTF-8?q?ification=20and=20HTML=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/mq-check/src/types.rs | 2 +- crates/mq-check/src/unify.rs | 13 +++++++------ .../mq-markdown/src/html_to_markdown/converter.rs | 10 ++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/mq-check/src/types.rs b/crates/mq-check/src/types.rs index 4cd324705..a72c4682a 100644 --- a/crates/mq-check/src/types.rs +++ b/crates/mq-check/src/types.rs @@ -485,7 +485,7 @@ impl Type { count += 1; } } - let field_score = if count > 0 { total / count } else { 10 }; + let field_score = total.checked_div(count).unwrap_or(10); let rest_score = r1.match_score(r2).unwrap_or(10); Some(field_score + rest_score + 20) } diff --git a/crates/mq-check/src/unify.rs b/crates/mq-check/src/unify.rs index 78e759c33..6e32760a7 100644 --- a/crates/mq-check/src/unify.rs +++ b/crates/mq-check/src/unify.rs @@ -129,12 +129,13 @@ pub fn unify( (Type::RowEmpty, Type::Dict(_, _)) | (Type::Dict(_, _), Type::RowEmpty) => {} // RowEmpty ↔ Record: closed row can absorb an empty record - (Type::RowEmpty, Type::Record(fields, rest)) | (Type::Record(fields, rest), Type::RowEmpty) => { - if fields.is_empty() { - unify(ctx, rest, &Type::RowEmpty, range, origin); - } else { - ctx.report_mismatch(t1, t2, range, origin); - } + (Type::RowEmpty, Type::Record(fields, rest)) | (Type::Record(fields, rest), Type::RowEmpty) + if fields.is_empty() => + { + unify(ctx, rest, &Type::RowEmpty, range, origin); + } + (Type::RowEmpty, Type::Record(..)) | (Type::Record(..), Type::RowEmpty) => { + ctx.report_mismatch(t1, t2, range, origin); } // Record ↔ Record (row polymorphism) diff --git a/crates/mq-markdown/src/html_to_markdown/converter.rs b/crates/mq-markdown/src/html_to_markdown/converter.rs index 2aaf52d6d..98ab1e8bb 100644 --- a/crates/mq-markdown/src/html_to_markdown/converter.rs +++ b/crates/mq-markdown/src/html_to_markdown/converter.rs @@ -555,12 +555,10 @@ pub fn convert_children_to_string(nodes: &[HtmlNode]) -> miette::Result parts.push("[ ] ".to_string()); } } - "text" | "number" | "button" | "url" | "email" => { - if element.attributes.contains_key("value") { - parts.push( - element.attributes.get("value").cloned().unwrap().unwrap_or_default(), - ); - } + "text" | "number" | "button" | "url" | "email" + if element.attributes.contains_key("value") => + { + parts.push(element.attributes.get("value").cloned().unwrap().unwrap_or_default()); } _ => {} }