diff --git a/.rustfmt.toml b/.rustfmt.toml index f87a9fd..e08fb36 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -8,7 +8,6 @@ error_on_line_overflow = true # Override the default formatting style. # See https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81. use_small_heuristics = "Max" -# This is the default of 2024 edition https://github.com/rust-lang/rust/pull/114764. # This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3370) overflow_delimited_expr = true # This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/4991). @@ -27,6 +26,7 @@ use_try_shorthand = true # Set the default settings again to always apply the proper formatting without # being affected by the editor settings. edition = "2018" +style_edition = "2024" hard_tabs = false newline_style = "Unix" tab_spaces = 4 diff --git a/src/ast.rs b/src/ast.rs index f167bae..f42a66a 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -2,7 +2,7 @@ use proc_macro::{Delimiter, Ident, Literal, Span, TokenStream, TokenTree}; -use crate::{iter::TokenIter, to_tokens::ToTokens, utils::tt_span, Result}; +use crate::{Result, iter::TokenIter, to_tokens::ToTokens, utils::tt_span}; pub(crate) struct Func { attrs: Vec, diff --git a/src/iter.rs b/src/iter.rs index 0d95b8a..86ace97 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -2,7 +2,7 @@ // Based on https://github.com/dtolnay/proc-macro-hack/blob/0.5.19/src/iter.rs -use proc_macro::{token_stream, Delimiter, TokenStream, TokenTree}; +use proc_macro::{Delimiter, TokenStream, TokenTree, token_stream}; pub(crate) struct TokenIter { stack: Vec, diff --git a/src/utils.rs b/src/utils.rs index e1cfaf0..e91be83 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,7 +4,7 @@ use std::iter::FromIterator; use proc_macro::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree}; -use crate::{iter::TokenIter, Result}; +use crate::{Result, iter::TokenIter}; pub(crate) fn tt_span(tt: Option<&TokenTree>) -> Span { tt.map_or_else(Span::call_site, TokenTree::span) diff --git a/test_suite/build.rs b/test_suite/build.rs index fb0a620..dd560ba 100644 --- a/test_suite/build.rs +++ b/test_suite/build.rs @@ -4,7 +4,9 @@ use std::{env, process::Command}; fn main() { println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rustc-check-cfg=cfg(rustc_1_31,rustc_1_33,rustc_1_39,rustc_1_46,rustc_1_61,rustc_1_83,const_unstable)"); + println!( + "cargo:rustc-check-cfg=cfg(rustc_1_31,rustc_1_33,rustc_1_39,rustc_1_46,rustc_1_61,rustc_1_83,const_unstable)" + ); let cfg = autocfg::new(); if cfg.probe_rustc_version(1, 31) {