Skip to content

Commit

Permalink
Rust-2024: use 2024 style
Browse files Browse the repository at this point in the history
Signed-off-by: 35V LG84 <[email protected]>
  • Loading branch information
35VLG84 committed Feb 9, 2025
1 parent dbd8678 commit 03956ff
Show file tree
Hide file tree
Showing 60 changed files with 131 additions and 157 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- run: rustup toolchain install nightly-x86_64-unknown-linux-gnu
- run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- run: rustup show
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
- run: cargo +nightly fmt --all --check -- --style-edition 2024

clippy:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ clean:

check:
cargo clippy --workspace --all-targets --no-deps -- -D warnings
cargo fmt --all --check
cargo +nightly fmt --all --check -- --style-edition 2024

fmt:
cargo +nightly fmt --all -- --style-edition 2024

test: (_test "debug")

Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style_edition = "2024"
3 changes: 1 addition & 2 deletions tackler-api/src/filters/filter_definition.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

use crate::filters::IndentDisplay;
use crate::filters::TxnFilter;
use base64::{engine::general_purpose, Engine as _};
use base64::{Engine as _, engine::general_purpose};
use jiff::tz::TimeZone;
use serde::{Deserialize, Serialize};
use std::fmt::{Display, Formatter};
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/posting/posting_account.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -36,12 +35,12 @@ impl IndentDisplay for TxnFilterPostingAccount {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: fdb5c728-1354-4905-8bc0-42c17cc6d948
Expand Down
7 changes: 3 additions & 4 deletions tackler-api/src/filters/posting/posting_amount_equal.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -12,7 +11,7 @@ use std::fmt::Formatter;
use tackler_rs::regex::peeled_pattern;
use tackler_rs::regex::serde::full_haystack_matcher;

use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};

/// Txn Posting "Amount is equal" filter
///
Expand Down Expand Up @@ -48,12 +47,12 @@ impl IndentDisplay for TxnFilterPostingAmountEqual {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: c63d9ff7-6039-474b-8b8a-be6b8927510f
Expand Down
7 changes: 3 additions & 4 deletions tackler-api/src/filters/posting/posting_amount_greater.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -12,7 +11,7 @@ use std::fmt::Formatter;
use tackler_rs::regex::peeled_pattern;
use tackler_rs::regex::serde::full_haystack_matcher;

use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};

/// Txn Posting "Amount is Greater than" filter
///
Expand Down Expand Up @@ -54,12 +53,12 @@ impl IndentDisplay for TxnFilterPostingAmountGreater {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: 8609eb58-f600-42d1-a20a-c7de2c57e6e2
Expand Down
7 changes: 3 additions & 4 deletions tackler-api/src/filters/posting/posting_amount_less.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -12,7 +11,7 @@ use std::fmt::Formatter;
use tackler_rs::regex::peeled_pattern;
use tackler_rs::regex::serde::full_haystack_matcher;

use crate::filters::{posting_filter_indent_fmt, IndentDisplay};
use crate::filters::{IndentDisplay, posting_filter_indent_fmt};

/// Txn Posting "Amount is Less than" filter
///
Expand Down Expand Up @@ -54,12 +53,12 @@ impl IndentDisplay for TxnFilterPostingAmountLess {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: 2d01669b-b051-4550-9436-ac31e84dd892
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/posting/posting_comment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterPostingComment {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: df851a3a-80b8-49ca-9dfa-f7b5ce122ddf
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/posting/posting_commodity.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterPostingCommodity {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: d2fbabba-f37c-4245-bf7a-0fed4db82695
Expand Down
3 changes: 1 addition & 2 deletions tackler-api/src/filters/txn/txn_bbox_lat_lon.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -45,7 +44,7 @@ impl IndentDisplay for TxnFilterBBoxLatLon {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
Expand Down
3 changes: 1 addition & 2 deletions tackler-api/src/filters/txn/txn_bbox_lat_lon_alt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -51,7 +50,7 @@ impl IndentDisplay for TxnFilterBBoxLatLonAlt {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_code.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -33,12 +32,12 @@ impl IndentDisplay for TxnFilterTxnCode {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: 2e005db0-f3f5-4ef4-a574-ed3371d4f5c9
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_comments.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterTxnComments {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: 3debf0d5-599f-41a2-9d5f-e16a54cb1e3e
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_description.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -37,12 +36,12 @@ impl IndentDisplay for TxnFilterTxnDescription {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: f2a52f9d-1fd6-428d-9bb4-7821d1f15ce3
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_tags.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -33,12 +32,12 @@ impl IndentDisplay for TxnFilterTxnTags {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
use tackler_rs::regex::new_full_haystack_regex;
use tackler_rs::IndocUtils;
use tackler_rs::regex::new_full_haystack_regex;

#[test]
// test: d2aa8d62-97cb-49e1-ac7b-f81a1a511b6b
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_ts_begin.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

use crate::filters::IndentDisplay;
use crate::txn_ts::rfc_3339;
use jiff::tz::TimeZone;
use jiff::Timestamp;
use jiff::tz::TimeZone;
use serde::{Deserialize, Serialize};
use std::fmt::Formatter;

Expand Down Expand Up @@ -41,7 +40,7 @@ impl IndentDisplay for TxnFilterTxnTSBegin {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
Expand Down
5 changes: 2 additions & 3 deletions tackler-api/src/filters/txn/txn_ts_end.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

use crate::filters::IndentDisplay;
use crate::txn_ts::rfc_3339;
use jiff::tz::TimeZone;
use jiff::Timestamp;
use jiff::tz::TimeZone;
use serde::{Deserialize, Serialize};
use std::fmt::Formatter;

Expand Down Expand Up @@ -41,7 +40,7 @@ impl IndentDisplay for TxnFilterTxnTSEnd {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
Expand Down
3 changes: 1 addition & 2 deletions tackler-api/src/filters/txn/txn_uuid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Tackler-NG 2023-2024
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -30,7 +29,7 @@ impl IndentDisplay for TxnFilterTxnUUID {
mod tests {
use super::*;
use crate::filters::{
logic::TxnFilterAND, FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter,
FilterDefZoned, FilterDefinition, NullaryTRUE, TxnFilter, logic::TxnFilterAND,
};
use indoc::indoc;
use jiff::tz;
Expand Down
2 changes: 1 addition & 1 deletion tackler-api/src/metadata/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use crate::filters::{FilterDefZoned, FilterDefinition};
use crate::metadata::Checksum;
use crate::txn_ts;
use jiff::tz::TimeZone;
use jiff::Zoned;
use jiff::tz::TimeZone;

#[doc(hidden)]
pub type MetadataItems = Vec<MetadataItem>;
Expand Down
Loading

0 comments on commit 03956ff

Please sign in to comment.