Skip to content

Commit 9acf9f8

Browse files
committed
fmt: Use the same rustfmt.toml everywhere
It isn't worth keeping a separate rustfmt.toml only for ctest, so switch to using the vertical formatting everywhere. (backport <rust-lang#4842>) (cherry picked from commit 04ab55d)
1 parent 3fd848d commit 9acf9f8

File tree

11 files changed

+74
-23
lines changed

11 files changed

+74
-23
lines changed

src/rustfmt.toml renamed to .rustfmt.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Note that there is a separate top-level configuration for everything else
21
edition = "2021"
32
error_on_line_overflow = true
43
group_imports = "StdExternalCrate"

build.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
use std::process::{Command, Output};
2-
use std::{env, str};
1+
use std::process::{
2+
Command,
3+
Output,
4+
};
5+
use std::{
6+
env,
7+
str,
8+
};
39

410
// List of cfgs this build script is allowed to set. The list is needed to support check-cfg, as we
511
// need to know all the possible cfgs that this script will set. If you need to set another cfg

ci/ios/deploy_and_run_on_ios_simulator.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
// (https://github.com/snipsco/dinghy): cargo dinghy install, then cargo dinghy
77
// test.
88

9-
use std::fs::{self, File};
9+
use std::fs::{
10+
self,
11+
File,
12+
};
1013
use std::io::Write;
1114
use std::path::Path;
1215
use std::process::Command;
13-
use std::{env, process};
16+
use std::{
17+
env,
18+
process,
19+
};
1420

1521
macro_rules! t {
1622
($e:expr) => {

ci/runtest-android.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use std::env;
2-
use std::path::{Path, PathBuf};
2+
use std::path::{
3+
Path,
4+
PathBuf,
5+
};
36
use std::process::Command;
47

58
fn main() {

libc-test/build.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22
#![allow(clippy::match_like_matches_macro)]
33

44
use std::fs::File;
5-
use std::io::{BufRead, BufReader, BufWriter, Write};
6-
use std::path::{Path, PathBuf};
7-
use std::{env, io};
5+
use std::io::{
6+
BufRead,
7+
BufReader,
8+
BufWriter,
9+
Write,
10+
};
11+
use std::path::{
12+
Path,
13+
PathBuf,
14+
};
15+
use std::{
16+
env,
17+
io,
18+
};
819

920
fn do_cc() {
1021
let target = env::var("TARGET").unwrap();

libc-test/tests/cmsg.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ mod t {
66

77
use std::mem;
88

9-
use libc::{self, c_uchar, c_uint, c_void, cmsghdr, msghdr};
9+
use libc::{
10+
self,
11+
c_uchar,
12+
c_uint,
13+
c_void,
14+
cmsghdr,
15+
msghdr,
16+
};
1017

1118
extern "C" {
1219
pub fn cmsg_firsthdr(msgh: *const msghdr) -> *mut cmsghdr;

libc-test/tests/errqueue.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
33
#[cfg(any(target_os = "linux", target_os = "android"))]
44
mod t {
5-
use libc::{self, sock_extended_err, sockaddr};
5+
use libc::{
6+
self,
7+
sock_extended_err,
8+
sockaddr,
9+
};
610

711
extern "C" {
812
pub fn so_ee_offender(ee: *const sock_extended_err) -> *mut sockaddr;

libc-test/tests/makedev.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
target_os = "cygwin",
1414
))]
1515

16-
use libc::{self, c_uint, dev_t};
16+
use libc::{
17+
self,
18+
c_uint,
19+
dev_t,
20+
};
1721

1822
cfg_if::cfg_if! {
1923
if #[cfg(any(target_os = "solaris", target_os = "illumos"))] {

libc-test/tests/style.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ pub mod style_lib;
1414
use std::env;
1515
use std::path::Path;
1616

17-
use style_lib::{Result, StyleChecker};
17+
use style_lib::{
18+
Result,
19+
StyleChecker,
20+
};
1821

1922
/// Relative to `src/`.
2023
const SKIP_PREFIXES: &[&str] = &[

libc-test/tests/style_lib/mod.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,26 @@
2828
use std::collections::HashMap;
2929
use std::fs;
3030
use std::ops::Deref;
31-
use std::path::{Path, PathBuf};
32-
33-
use annotate_snippets::{Level, Renderer, Snippet};
31+
use std::path::{
32+
Path,
33+
PathBuf,
34+
};
35+
36+
use annotate_snippets::{
37+
Level,
38+
Renderer,
39+
Snippet,
40+
};
3441
use proc_macro2::Span;
35-
use syn::parse::{Parse, ParseStream};
42+
use syn::parse::{
43+
Parse,
44+
ParseStream,
45+
};
3646
use syn::spanned::Spanned;
37-
use syn::visit::{self, Visit};
47+
use syn::visit::{
48+
self,
49+
Visit,
50+
};
3851
use syn::Token;
3952

4053
const ALLOWED_REPEATED_MACROS: &[&str] = &["s", "s_no_extra_traits", "s_paren"];

0 commit comments

Comments
 (0)