Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Auto merge of #1408 - Xanewok:bump-rustfmt, r=Xanewok
Browse files Browse the repository at this point in the history
Update Rustfmt to 1.2

In case it's needed by rust-lang/rust#59454.
  • Loading branch information
bors committed Apr 5, 2019
2 parents 2d18d3d + 590c4dc commit f38185d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ racer = { version = "2.1.21", default-features = false }
rand = "0.6"
rayon = "1"
rustc_tools_util = "0.1.1"
rustfmt-nightly = "1.1"
rustfmt-nightly = "1.2"
rustc-serialize = "0.3"
serde = "1.0"
serde_json = "1.0"
Expand Down
15 changes: 11 additions & 4 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,8 +1788,8 @@ fn client_reformat_with_range() {
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
},
range: Range {
start: Position { line: 2, character: 0 },
end: Position { line: 3, character: 0 },
start: Position { line: 1, character: 0 },
end: Position { line: 2, character: 0 },
},
options: FormattingOptions {
tab_size: 4,
Expand All @@ -1800,8 +1800,15 @@ fn client_reformat_with_range() {
);

let newline = if cfg!(windows) { "\r\n" } else { "\n" };
let formatted = "pub fn main() {\n let world1 = \"world\";\n println!(\"Hello, {}!\", world1);\n let world2 = \"world\";\n println!(\"Hello, {}!\", world2);\n let world3 = \"world\";\n println!(\"Hello, {}!\", world3);\n}\n"
.replace("\n", newline);
let formatted = r#"pub fn main() {
let world1 = "world";
println!("Hello, {}!", world1);
let world2 = "world"; println!("Hello, {}!", world2);
let world3 = "world"; println!("Hello, {}!", world3);
}
"#
.replace("\r", "")
.replace("\n", newline);

assert_eq!(result.unwrap()[0].new_text, formatted);
}
Expand Down

0 comments on commit f38185d

Please sign in to comment.