Skip to content

Commit 8972edd

Browse files
committed
Adopt the same rustfmt config as rust
1 parent 2c3e2f5 commit 8972edd

File tree

11 files changed

+45
-50
lines changed

11 files changed

+45
-50
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on: [ push, pull_request ]
1+
on: [push, pull_request]
22

33
name: Build
44

benches/bench.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput};
22
use num_traits::Float;
3+
use phastft::options::Options;
4+
use phastft::planner::{Direction, Planner32, Planner64, PlannerDit32, PlannerDit64};
35
use phastft::{
46
fft_32_dit_with_planner_and_opts, fft_32_with_opts_and_plan, fft_64_dit_with_planner_and_opts,
57
fft_64_with_opts_and_plan,
6-
options::Options,
7-
planner::{Direction, Planner32, Planner64, PlannerDit32, PlannerDit64},
88
};
9-
use rand::{distr::StandardUniform, prelude::Distribution, rng, Rng};
9+
use rand::distr::StandardUniform;
10+
use rand::prelude::Distribution;
11+
use rand::{rng, Rng};
1012
use utilities::rustfft::num_complex::Complex;
1113
use utilities::rustfft::FftPlanner;
1214

examples/benchmark.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use phastft::fft_64_dit_with_planner;
2-
use phastft::fft_64_with_opts_and_plan;
3-
use phastft::options::Options;
4-
use phastft::planner::{Direction, Planner64, PlannerDit64};
51
use std::env;
62
use std::str::FromStr;
3+
4+
use phastft::options::Options;
5+
use phastft::planner::{Direction, Planner64, PlannerDit64};
6+
use phastft::{fft_64_dit_with_planner, fft_64_with_opts_and_plan};
77
use utilities::gen_random_signal;
88

99
fn benchmark_fft_64(n: usize) {

examples/benchmark_dit_planner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use phastft::fft_64_dit;
2-
use phastft::fft_64_dit_with_planner;
3-
use phastft::planner::{Direction, PlannerDit64};
41
use std::env;
52
use std::str::FromStr;
3+
4+
use phastft::planner::{Direction, PlannerDit64};
5+
use phastft::{fft_64_dit, fft_64_dit_with_planner};
66
use utilities::gen_random_signal;
77

88
fn benchmark_dit_with_planner(n: usize, iterations: usize) {

examples/bit_reversal_control.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use phastft::{
2-
fft_64, fft_64_dit, fft_64_with_opts_and_plan,
3-
options::Options,
4-
planner::{Direction, Planner64},
5-
};
1+
use phastft::options::Options;
2+
use phastft::planner::{Direction, Planner64};
3+
use phastft::{fft_64, fft_64_dit, fft_64_with_opts_and_plan};
64

75
/// This example demonstrates the bit reversal behavior of DIF and DIT FFT algorithms
86
/// and how to control bit reversal in DIF FFT.

examples/fftwrb.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
use std::{env, ptr::slice_from_raw_parts_mut, str::FromStr};
1+
use std::env;
2+
use std::ptr::slice_from_raw_parts_mut;
3+
use std::str::FromStr;
24

3-
use fftw::{
4-
array::AlignedVec,
5-
plan::{C2CPlan, C2CPlan64},
6-
types::{Flag, Sign},
7-
};
8-
use utilities::{gen_random_signal, rustfft::num_complex::Complex};
5+
use fftw::array::AlignedVec;
6+
use fftw::plan::{C2CPlan, C2CPlan64};
7+
use fftw::types::{Flag, Sign};
8+
use utilities::gen_random_signal;
9+
use utilities::rustfft::num_complex::Complex;
910

1011
fn benchmark_fftw(n: usize) {
1112
let big_n = 1 << n;

examples/profile.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use std::env;
22
use std::str::FromStr;
33

4-
use utilities::gen_random_signal;
5-
64
use phastft::options::Options;
75
use phastft::planner::{Direction, Planner64};
86
use phastft::{fft_64_dit, fft_64_with_opts_and_plan};
7+
use utilities::gen_random_signal;
98

109
fn benchmark_fft_64(n: usize) {
1110
let big_n = 1 << n;

examples/rustfft.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::env;
22
use std::str::FromStr;
33

4-
use utilities::{
5-
gen_random_signal,
6-
rustfft::{num_complex::Complex64, FftPlanner},
7-
};
4+
use utilities::gen_random_signal;
5+
use utilities::rustfft::num_complex::Complex64;
6+
use utilities::rustfft::FftPlanner;
87

98
fn benchmark_rustfft(n: usize) {
109
let big_n = 1 << n;

hooks/pre-commit

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22

33
set -eu
44

5-
if ! cargo fmt --all -- --check
6-
then
7-
echo "There are some code style issues."
8-
echo "Run cargo fmt first."
9-
exit 1
5+
if ! cargo +nightly fmt --all -- --check; then
6+
echo "There are some code style issues."
7+
echo "Run cargo fmt first."
8+
exit 1
109
fi
1110

12-
if ! cargo clippy --all-targets --all-features --tests -- -D warnings
13-
then
14-
echo "There are some clippy issues."
15-
exit 1
11+
if ! cargo clippy --all-targets --all-features --tests -- -D warnings; then
12+
echo "There are some clippy issues."
13+
exit 1
1614
fi
1715

18-
if ! cargo test --all-features
19-
then
20-
echo "There are some test issues."
21-
exit 1
16+
if ! cargo test --all-features; then
17+
echo "There are some test issues."
18+
exit 1
2219
fi
2320

2421
exit 0

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#![feature(portable_simd)]
1212
#![feature(doc_cfg)]
1313

14-
#[cfg(feature = "complex-nums")]
15-
use crate::utils::{combine_re_im, deinterleave_complex32, deinterleave_complex64};
1614
#[cfg(feature = "complex-nums")]
1715
use num_complex::Complex;
1816

@@ -27,6 +25,8 @@ use crate::kernels::{
2725
use crate::options::Options;
2826
use crate::planner::{Direction, Planner32, Planner64, PlannerDit32, PlannerDit64};
2927
use crate::twiddles::filter_twiddles;
28+
#[cfg(feature = "complex-nums")]
29+
use crate::utils::{combine_re_im, deinterleave_complex32, deinterleave_complex64};
3030

3131
pub mod cobra;
3232
mod kernels;

0 commit comments

Comments
 (0)