Skip to content

Commit 5a88d5f

Browse files
authored
Remove version (#4235)
1 parent 5cddd34 commit 5a88d5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+8
-89
lines changed

Configurations.md

Lines changed: 0 additions & 16 deletions

Makefile.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ args = [
3333
]
3434

3535
[tasks.test-all]
36+
dependencies = ["build-bin"]
3637
run_task = { name = ["test", "test-ignored"] }
3738

3839
[tasks.test-ignored]

config_proc_macro/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
target/
1+
target/
2+
3+
Cargo.lock

rustfmt.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
error_on_line_overflow = true
22
error_on_unformatted = true
3-
version = "Two"

src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ create_config! {
126126
blank_lines_lower_bound: usize, 0, false,
127127
"Minimum number of blank lines which must be put between items";
128128
edition: Edition, Edition::Edition2018, true, "The edition of the parser (RFC 2052)";
129-
version: Version, Version::One, false, "Version of formatting rules";
130129
inline_attribute_width: usize, 0, false,
131130
"Write an item and its attribute on the same line \
132131
if their combined width is below a threshold";
@@ -615,7 +614,6 @@ match_block_trailing_comma = false
615614
blank_lines_upper_bound = 1
616615
blank_lines_lower_bound = 0
617616
edition = "2018"
618-
version = "One"
619617
inline_attribute_width = 0
620618
merge_derives = true
621619
use_try_shorthand = false

src/config/license.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ use std::fs::File;
33
use std::io;
44
use std::io::Read;
55

6+
use itertools::Itertools;
67
use regex::Regex;
78

9+
use self::ParsingState::*;
10+
811
#[derive(Debug)]
912
pub(crate) enum LicenseError {
1013
IO(io::Error),
@@ -44,8 +47,6 @@ enum ParsingState {
4447
Abort(String),
4548
}
4649

47-
use self::ParsingState::*;
48-
4950
pub(crate) struct TemplateParser {
5051
parsed: String,
5152
buffer: String,
@@ -111,7 +112,7 @@ impl TemplateParser {
111112
/// ```
112113
pub(crate) fn parse(template: &str) -> Result<String, LicenseError> {
113114
let mut parser = Self::new();
114-
for chr in template.chars() {
115+
for chr in template.lines().join("\n").chars() {
115116
if chr == '\n' {
116117
parser.linum += 1;
117118
}

tests/source/configs/indent_style/block_trailing_comma_call/two.rs renamed to tests/source/configs/indent_style/block_trailing_comma_call.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
// rustfmt-error_on_line_overflow: false
32
// rustfmt-indent_style: Block
43

tests/source/fn-single-line/version_two.rs renamed to tests/source/fn-single-line.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// rustfmt-fn_single_line: true
2-
// rustfmt-version: Two
32
// Test single-line functions.
43

54
fn foo_expr() {

tests/source/issue-2179/two.rs renamed to tests/source/issue-2179.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
// rustfmt-error_on_line_overflow: false
32

43
fn issue_2179() {

tests/source/issue-3213/version_two.rs renamed to tests/source/issue-3213.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// rustfmt-version: Two
2-
31
fn foo() {
42
match 0 {
53
0 => return AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,

0 commit comments

Comments
 (0)