Skip to content

Commit d085b21

Browse files
Fix rustfmt test (#445)
## Product change and motivation ## Implementation
1 parent 5e64a01 commit d085b21

55 files changed

Lines changed: 3403 additions & 134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
3333
rust.toolchain(
3434
edition = "2024",
3535
versions = ["1.93.0"],
36+
rustfmt_version = "nightly/2026-04-15",
3637
)
3738
use_repo(rust, "rust_toolchains")
3839
register_toolchains("@rust_toolchains//:all")

MODULE.bazel.lock

Lines changed: 3275 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/annotation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use std::fmt::{self, Write};
88

99
use crate::{
10-
common::{identifier::Identifier, token, Span, Spanned},
10+
common::{Span, Spanned, identifier::Identifier, token},
1111
util::write_joined,
1212
value::{IntegerLiteral, Literal, StringLiteral},
1313
};

rust/benches/bench_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::{fs::File, os::raw::c_int, path::Path};
88

9-
use criterion::{criterion_group, criterion_main, profiler::Profiler, Criterion};
9+
use criterion::{Criterion, criterion_group, criterion_main, profiler::Profiler};
1010
use pprof::ProfilerGuard;
1111

1212
const N_LINES: usize = 1000;

rust/common/error/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{error::Error as StdError, fmt};
88

99
use pest::error::{Error as PestError, LineColLocation};
1010

11-
use crate::{common::Spannable, error_messages, util::write_joined, Identifier};
11+
use crate::{Identifier, common::Spannable, error_messages, util::write_joined};
1212

1313
#[macro_use]
1414
mod macros;
@@ -65,11 +65,7 @@ impl fmt::Display for Error {
6565

6666
pub fn collect_err(i: impl IntoIterator<Item = Result<(), Error>>) -> Result<(), Error> {
6767
let errors = i.into_iter().filter_map(Result::err).flat_map(|e| e.errors).collect::<Vec<_>>();
68-
if errors.is_empty() {
69-
Ok(())
70-
} else {
71-
Err(Error { errors })
72-
}
68+
if errors.is_empty() { Ok(()) } else { Err(Error { errors }) }
7369
}
7470

7571
error_messages! { TypeQLError

rust/common/identifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{fmt, sync::OnceLock};
99
use regex::Regex;
1010

1111
use crate::{
12-
common::{error::TypeQLError, Span, Spanned},
12+
common::{Span, Spanned, error::TypeQLError},
1313
is_reserved_keyword,
1414
pretty::Pretty,
1515
};

rust/common/string.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,5 @@ pub(crate) fn unescape_regex(regex: &str) -> String {
2020

2121
pub(crate) fn format_double(double: f64) -> String {
2222
let formatted = format!("{double:.12}").trim_end_matches('0').to_string();
23-
if formatted.ends_with('.') {
24-
formatted + "0"
25-
} else {
26-
formatted
27-
}
23+
if formatted.ends_with('.') { formatted + "0" } else { formatted }
2824
}

rust/expression/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use std::fmt::{self, Write};
88

99
use crate::{
1010
common::{
11+
Span, Spanned,
1112
identifier::Identifier,
1213
token::{self, ArithmeticOperator},
13-
Span, Spanned,
1414
},
1515
pretty::Pretty,
1616
util::write_joined,

rust/parser/annotation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
*/
66

77
use super::{
8+
IntoChildNodes, Node, Rule, RuleMatcher,
89
literal::{visit_integer_literal, visit_quoted_string_literal, visit_value_literal},
9-
visit_identifier, IntoChildNodes, Node, Rule, RuleMatcher,
10+
visit_identifier,
1011
};
1112
use crate::{
1213
annotation::{
1314
Abstract, Annotation, Cardinality, CardinalityRange, Cascade, Distinct, Independent, Key, Range, Regex, Subkey,
1415
Unique, Values,
1516
},
16-
common::{error::TypeQLError, Spanned},
17+
common::{Spanned, error::TypeQLError},
1718
value::Literal,
1819
};
1920

rust/parser/define/function.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
use itertools::Itertools;
88

99
use crate::{
10-
common::{error::TypeQLError, Spanned},
10+
common::{Spanned, error::TypeQLError},
1111
parser::{
12+
IntoChildNodes, Node, Rule, RuleMatcher,
1213
pipeline::{visit_query_stage, visit_reducer},
1314
type_::visit_named_type_any,
14-
visit_identifier, visit_var, visit_vars, IntoChildNodes, Node, Rule, RuleMatcher,
15+
visit_identifier, visit_var, visit_vars,
1516
},
1617
schema::definable::{
18+
Function,
1719
function::{
1820
Argument, Check, FunctionBlock, Output, ReturnReduction, ReturnSingle, ReturnStatement, ReturnStream,
1921
Signature, Single, SingleSelector, Stream,
2022
},
21-
Function,
2223
},
2324
};
2425

0 commit comments

Comments
 (0)