Skip to content

Commit 03956ff

Browse files
committed
Rust-2024: use 2024 style
Signed-off-by: 35V LG84 <[email protected]>
1 parent dbd8678 commit 03956ff

Some content is hidden

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

60 files changed

+131
-157
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ jobs:
1313
- uses: actions/checkout@v4
1414
with:
1515
submodules: 'true'
16+
- run: rustup toolchain install nightly-x86_64-unknown-linux-gnu
17+
- run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
1618
- run: rustup show
1719
- uses: Swatinem/rust-cache@v2
18-
- run: cargo fmt --all --check
20+
- run: cargo +nightly fmt --all --check -- --style-edition 2024
1921

2022
clippy:
2123
runs-on: ubuntu-latest

justfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ clean:
2020

2121
check:
2222
cargo clippy --workspace --all-targets --no-deps -- -D warnings
23-
cargo fmt --all --check
23+
cargo +nightly fmt --all --check -- --style-edition 2024
24+
25+
fmt:
26+
cargo +nightly fmt --all -- --style-edition 2024
2427

2528
test: (_test "debug")
2629

rustfmt.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style_edition = "2024"

tackler-api/src/filters/filter_definition.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

76
use crate::filters::IndentDisplay;
87
use crate::filters::TxnFilter;
9-
use base64::{engine::general_purpose, Engine as _};
8+
use base64::{Engine as _, engine::general_purpose};
109
use jiff::tz::TimeZone;
1110
use serde::{Deserialize, Serialize};
1211
use std::fmt::{Display, Formatter};

tackler-api/src/filters/posting/posting_account.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -36,12 +35,12 @@ impl IndentDisplay for TxnFilterPostingAccount {
3635
mod tests {
3736
use super::*;
3837
use crate::filters::{
39-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
38+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4039
};
4140
use indoc::indoc;
4241
use jiff::tz;
43-
use tackler_rs::regex::new_full_haystack_regex;
4442
use tackler_rs::IndocUtils;
43+
use tackler_rs::regex::new_full_haystack_regex;
4544

4645
#[test]
4746
// test: fdb5c728-1354-4905-8bc0-42c17cc6d948

tackler-api/src/filters/posting/posting_amount_equal.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -12,7 +11,7 @@ use std::fmt::Formatter;
1211
use tackler_rs::regex::peeled_pattern;
1312
use tackler_rs::regex::serde::full_haystack_matcher;
1413

15-
use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
14+
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};
1615

1716
/// Txn Posting "Amount is equal" filter
1817
///
@@ -48,12 +47,12 @@ impl IndentDisplay for TxnFilterPostingAmountEqual {
4847
mod tests {
4948
use super::*;
5049
use crate::filters::{
51-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
50+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
5251
};
5352
use indoc::indoc;
5453
use jiff::tz;
55-
use tackler_rs::regex::new_full_haystack_regex;
5654
use tackler_rs::IndocUtils;
55+
use tackler_rs::regex::new_full_haystack_regex;
5756

5857
#[test]
5958
// test: c63d9ff7-6039-474b-8b8a-be6b8927510f

tackler-api/src/filters/posting/posting_amount_greater.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -12,7 +11,7 @@ use std::fmt::Formatter;
1211
use tackler_rs::regex::peeled_pattern;
1312
use tackler_rs::regex::serde::full_haystack_matcher;
1413

15-
use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
14+
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};
1615

1716
/// Txn Posting "Amount is Greater than" filter
1817
///
@@ -54,12 +53,12 @@ impl IndentDisplay for TxnFilterPostingAmountGreater {
5453
mod tests {
5554
use super::*;
5655
use crate::filters::{
57-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
56+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
5857
};
5958
use indoc::indoc;
6059
use jiff::tz;
61-
use tackler_rs::regex::new_full_haystack_regex;
6260
use tackler_rs::IndocUtils;
61+
use tackler_rs::regex::new_full_haystack_regex;
6362

6463
#[test]
6564
// test: 8609eb58-f600-42d1-a20a-c7de2c57e6e2

tackler-api/src/filters/posting/posting_amount_less.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -12,7 +11,7 @@ use std::fmt::Formatter;
1211
use tackler_rs::regex::peeled_pattern;
1312
use tackler_rs::regex::serde::full_haystack_matcher;
1413

15-
use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
14+
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};
1615

1716
/// Txn Posting "Amount is Less than" filter
1817
///
@@ -54,12 +53,12 @@ impl IndentDisplay for TxnFilterPostingAmountLess {
5453
mod tests {
5554
use super::*;
5655
use crate::filters::{
57-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
56+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
5857
};
5958
use indoc::indoc;
6059
use jiff::tz;
61-
use tackler_rs::regex::new_full_haystack_regex;
6260
use tackler_rs::IndocUtils;
61+
use tackler_rs::regex::new_full_haystack_regex;
6362

6463
#[test]
6564
// test: 2d01669b-b051-4550-9436-ac31e84dd892

tackler-api/src/filters/posting/posting_comment.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterPostingComment {
3736
mod tests {
3837
use super::*;
3938
use crate::filters::{
40-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
39+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4140
};
4241
use indoc::indoc;
4342
use jiff::tz;
44-
use tackler_rs::regex::new_full_haystack_regex;
4543
use tackler_rs::IndocUtils;
44+
use tackler_rs::regex::new_full_haystack_regex;
4645

4746
#[test]
4847
// test: df851a3a-80b8-49ca-9dfa-f7b5ce122ddf

tackler-api/src/filters/posting/posting_commodity.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterPostingCommodity {
3736
mod tests {
3837
use super::*;
3938
use crate::filters::{
40-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
39+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4140
};
4241
use indoc::indoc;
4342
use jiff::tz;
44-
use tackler_rs::regex::new_full_haystack_regex;
4543
use tackler_rs::IndocUtils;
44+
use tackler_rs::regex::new_full_haystack_regex;
4645

4746
#[test]
4847
// test: d2fbabba-f37c-4245-bf7a-0fed4db82695

tackler-api/src/filters/txn/txn_bbox_lat_lon.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -45,7 +44,7 @@ impl IndentDisplay for TxnFilterBBoxLatLon {
4544
mod tests {
4645
use super::*;
4746
use crate::filters::{
48-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
47+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4948
};
5049
use indoc::indoc;
5150
use jiff::tz;

tackler-api/src/filters/txn/txn_bbox_lat_lon_alt.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -51,7 +50,7 @@ impl IndentDisplay for TxnFilterBBoxLatLonAlt {
5150
mod tests {
5251
use super::*;
5352
use crate::filters::{
54-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
53+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
5554
};
5655
use indoc::indoc;
5756
use jiff::tz;

tackler-api/src/filters/txn/txn_code.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -33,12 +32,12 @@ impl IndentDisplay for TxnFilterTxnCode {
3332
mod tests {
3433
use super::*;
3534
use crate::filters::{
36-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
35+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
3736
};
3837
use indoc::indoc;
3938
use jiff::tz;
40-
use tackler_rs::regex::new_full_haystack_regex;
4139
use tackler_rs::IndocUtils;
40+
use tackler_rs::regex::new_full_haystack_regex;
4241

4342
#[test]
4443
// test: 2e005db0-f3f5-4ef4-a574-ed3371d4f5c9

tackler-api/src/filters/txn/txn_comments.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterTxnComments {
3736
mod tests {
3837
use super::*;
3938
use crate::filters::{
40-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
39+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4140
};
4241
use indoc::indoc;
4342
use jiff::tz;
44-
use tackler_rs::regex::new_full_haystack_regex;
4543
use tackler_rs::IndocUtils;
44+
use tackler_rs::regex::new_full_haystack_regex;
4645

4746
#[test]
4847
// test: 3debf0d5-599f-41a2-9d5f-e16a54cb1e3e

tackler-api/src/filters/txn/txn_description.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterTxnDescription {
3736
mod tests {
3837
use super::*;
3938
use crate::filters::{
40-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
39+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4140
};
4241
use indoc::indoc;
4342
use jiff::tz;
44-
use tackler_rs::regex::new_full_haystack_regex;
4543
use tackler_rs::IndocUtils;
44+
use tackler_rs::regex::new_full_haystack_regex;
4645

4746
#[test]
4847
// test: f2a52f9d-1fd6-428d-9bb4-7821d1f15ce3

tackler-api/src/filters/txn/txn_tags.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -33,12 +32,12 @@ impl IndentDisplay for TxnFilterTxnTags {
3332
mod tests {
3433
use super::*;
3534
use crate::filters::{
36-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
35+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
3736
};
3837
use indoc::indoc;
3938
use jiff::tz;
40-
use tackler_rs::regex::new_full_haystack_regex;
4139
use tackler_rs::IndocUtils;
40+
use tackler_rs::regex::new_full_haystack_regex;
4241

4342
#[test]
4443
// test: d2aa8d62-97cb-49e1-ac7b-f81a1a511b6b

tackler-api/src/filters/txn/txn_ts_begin.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

76
use crate::filters::IndentDisplay;
87
use crate::txn_ts::rfc_3339;
9-
use jiff::tz::TimeZone;
108
use jiff::Timestamp;
9+
use jiff::tz::TimeZone;
1110
use serde::{Deserialize, Serialize};
1211
use std::fmt::Formatter;
1312

@@ -41,7 +40,7 @@ impl IndentDisplay for TxnFilterTxnTSBegin {
4140
mod tests {
4241
use super::*;
4342
use crate::filters::{
44-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
43+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4544
};
4645
use indoc::indoc;
4746
use jiff::tz;

tackler-api/src/filters/txn/txn_ts_end.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

76
use crate::filters::IndentDisplay;
87
use crate::txn_ts::rfc_3339;
9-
use jiff::tz::TimeZone;
108
use jiff::Timestamp;
9+
use jiff::tz::TimeZone;
1110
use serde::{Deserialize, Serialize};
1211
use std::fmt::Formatter;
1312

@@ -41,7 +40,7 @@ impl IndentDisplay for TxnFilterTxnTSEnd {
4140
mod tests {
4241
use super::*;
4342
use crate::filters::{
44-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
43+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
4544
};
4645
use indoc::indoc;
4746
use jiff::tz;

tackler-api/src/filters/txn/txn_uuid.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Tackler-NG 2023-2024
3-
*
43
* SPDX-License-Identifier: Apache-2.0
54
*/
65

@@ -30,7 +29,7 @@ impl IndentDisplay for TxnFilterTxnUUID {
3029
mod tests {
3130
use super::*;
3231
use crate::filters::{
33-
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
32+
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
3433
};
3534
use indoc::indoc;
3635
use jiff::tz;

tackler-api/src/metadata/items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use crate::filters::{FilterDefZoned, FilterDefinition};
1010
use crate::metadata::Checksum;
1111
use crate::txn_ts;
12-
use jiff::tz::TimeZone;
1312
use jiff::Zoned;
13+
use jiff::tz::TimeZone;
1414

1515
#[doc(hidden)]
1616
pub type MetadataItems = Vec<MetadataItem>;

0 commit comments

Comments
 (0)