Skip to content

Commit

Permalink
Ran rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrimati1992 committed Dec 6, 2024
1 parent f7498da commit 010ad2c
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 159 deletions.
6 changes: 1 addition & 5 deletions const_format/src/__str_methods/str_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ impl SplitInput {
}
}

pub const fn count_splits(
SplitInput {
str, pattern, ..
}: SplitInput,
) -> usize {
pub const fn count_splits(SplitInput { str, pattern, .. }: SplitInput) -> usize {
let mut count = 1;

match pattern.normalize() {
Expand Down
10 changes: 4 additions & 6 deletions const_format/src/macros/helper_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ macro_rules! identity {
($($tt:tt)*) => { $($tt)* };
}


#[cfg(not(feature = "rust_1_83"))]
#[doc(hidden)]
#[macro_export]
macro_rules! __str_const {
($e:expr) => {
$crate::pmr::__AssertStr {x: $e}.x
$crate::pmr::__AssertStr { x: $e }.x
};
}

Expand All @@ -30,7 +29,7 @@ macro_rules! __str_const {
#[macro_export]
macro_rules! __str_const {
($e:expr) => {
const { $crate::pmr::__AssertStr {x: $e}.x }
const { $crate::pmr::__AssertStr { x: $e }.x }
};
}

Expand All @@ -39,7 +38,7 @@ macro_rules! __str_const {
#[macro_export]
macro_rules! __const {
($ty:ty => $e:expr) => {
$crate::pmr::__AssertType::<$ty> {x: $e}.x
$crate::pmr::__AssertType::<$ty> { x: $e }.x
};
}

Expand All @@ -48,11 +47,10 @@ macro_rules! __const {
#[macro_export]
macro_rules! __const {
($ty:ty => $e:expr) => {
const { $crate::pmr::__AssertType::<$ty> {x: $e}.x }
const { $crate::pmr::__AssertType::<$ty> { x: $e }.x }
};
}


#[doc(hidden)]
#[macro_export]
macro_rules! iter_copy_slice{
Expand Down
26 changes: 14 additions & 12 deletions const_format/src/macros/map_ascii_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@
/// ```
#[macro_export]
macro_rules! map_ascii_case {
($case:expr, $str:expr) => {$crate::__str_const! {{
const S_OSRCTFL4A: &$crate::pmr::str = $str;
const CASE_OSRCTFL4A: $crate::Case = $case;
{
const L: $crate::pmr::usize =
$crate::__ascii_case_conv::size_after_conversion(CASE_OSRCTFL4A, S_OSRCTFL4A);
($case:expr, $str:expr) => {
$crate::__str_const! {{
const S_OSRCTFL4A: &$crate::pmr::str = $str;
const CASE_OSRCTFL4A: $crate::Case = $case;
{
const L: $crate::pmr::usize =
$crate::__ascii_case_conv::size_after_conversion(CASE_OSRCTFL4A, S_OSRCTFL4A);

const OB: &[$crate::pmr::u8; L] =
&$crate::__ascii_case_conv::convert_str::<L>(CASE_OSRCTFL4A, S_OSRCTFL4A);
const OB: &[$crate::pmr::u8; L] =
&$crate::__ascii_case_conv::convert_str::<L>(CASE_OSRCTFL4A, S_OSRCTFL4A);

const OS: &$crate::pmr::str = unsafe { $crate::__priv_transmute_bytes_to_str!(OB) };
const OS: &$crate::pmr::str = unsafe { $crate::__priv_transmute_bytes_to_str!(OB) };

OS
}
}}};
OS
}
}}
};
}
Loading

0 comments on commit 010ad2c

Please sign in to comment.