Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ]

2 changes: 1 addition & 1 deletion crates/mq-check/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
13 changes: 7 additions & 6 deletions crates/mq-check/src/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 4 additions & 6 deletions crates/mq-markdown/src/html_to_markdown/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,10 @@ pub fn convert_children_to_string(nodes: &[HtmlNode]) -> miette::Result<String>
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());
}
_ => {}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.94.1"
channel = "1.95.0"
profile = "default"
Loading