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,

tests/source/issue-3227/two.rs renamed to tests/source/issue-3227.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 main() {
42
thread::spawn(|| {
53
while true {

tests/source/issue-3270/two.rs renamed to tests/source/issue-3270/default.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
pub fn main() {
42
/* let s = String::from(
53
"

tests/source/issue-3272/v2.rs renamed to tests/source/issue-3272.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 main() {
42
assert!(HAYSTACK
53
.par_iter()

tests/target/issue-3278/version_two.rs renamed to tests/source/issue-3278.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
pub fn parse_conditional<'a, I: 'a>()
42
-> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
53
where

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
pub enum TestEnum {
32
a,
43
b,

tests/source/issue-3302.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
macro_rules! moo1 {
42
() => {
53
bar! {

tests/source/issue-3701/two.rs renamed to tests/source/issue-3701.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 build_sorted_static_get_entry_names(
42
mut entries: Vec<(u8, &'static str)>,
53
) -> (impl Fn(

tests/source/issue-3840/version-two_hard-tabs.rs renamed to tests/source/issue-3840/hard-tabs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// rustfmt-hard_tabs: true
2-
// rustfmt-version: Two
32

43
impl<Target: FromEvent<A> + FromEvent<B>, A: Widget2<Ctx = C>, B: Widget2<Ctx = C>, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter<Target, A, B>
54
{

tests/source/issue-3840/version-two_soft-tabs.rs renamed to tests/source/issue-3840/soft-tabs.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
impl<Target: FromEvent<A> + FromEvent<B>, A: Widget2<Ctx = C>, B: Widget2<Ctx = C>, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter<Target, A, B>
42
{
53
type Ctx = C;

tests/source/issue-3904/two.rs renamed to tests/source/issue-3904.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 main() {
42
let checkkwd = (0x2i32 | 0x1i32) as i64; /* unrecognized "\z": print both chars unless ' or " */
53

tests/source/long-fn-1/version_two.rs renamed to tests/source/long-fn-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
// Tests that a function which is almost short enough, but not quite, gets
32
// formatted correctly.
43

tests/source/one_line_if_v2.rs renamed to tests/source/one_line_if.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 plain_if(x: bool) -> u8 {
42
if x {
53
0

tests/source/single-line-macro/v2.rs renamed to tests/source/single-line-macro.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
// #2652
42
// Preserve trailing comma inside macro, even if it looks an array.
53
macro_rules! bar {

tests/source/trailing_comments/hard_tabs.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-wrap_comments: true
32
// rustfmt-hard_tabs: true
43

tests/source/trailing_comments/soft_tabs.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-wrap_comments: true
32

43
pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast

tests/target/configs/indent_style/block_trailing_comma_call/two.rs renamed to tests/target/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/target/fn-single-line/version_two.rs renamed to tests/target/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() { 1 }

tests/target/issue-2179/two.rs renamed to tests/target/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/target/issue-3132.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 test() {
42
/*
53
a

tests/target/issue-3213/version_two.rs renamed to tests/target/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 => {

tests/target/issue-3227/two.rs renamed to tests/target/issue-3227.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 main() {
42
thread::spawn(|| {
53
while true {

tests/target/issue-3270/two.rs renamed to tests/target/issue-3270/default.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
pub fn main() {
42
/* let s = String::from(
53
"

tests/target/issue-3270/wrap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// rustfmt-wrap_comments: true
2-
// rustfmt-version: Two
32

43
// check that a line below max_width does not get over the limit when wrapping
54
// it in a block comment

tests/target/issue-3272/v2.rs renamed to tests/target/issue-3272.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 main() {
42
assert!(
53
HAYSTACK

tests/source/issue-3278/version_two.rs renamed to tests/target/issue-3278.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
pub fn parse_conditional<'a, I: 'a>()
42
-> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
53
where

tests/target/issue-3295/two.rs renamed to tests/target/issue-3295.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
pub enum TestEnum {
32
a,
43
b,

tests/target/issue-3302.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
macro_rules! moo1 {
42
() => {
53
bar! {

tests/target/issue-3614/version_two.rs renamed to tests/target/issue-3614.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 main() {
42
let toto = || {
53
if true { 42 } else { 24 }

tests/target/issue-3701/two.rs renamed to tests/target/issue-3701.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 build_sorted_static_get_entry_names(
42
mut entries: Vec<(u8, &'static str)>,
53
) -> (

tests/target/issue-3840/version-two_hard-tabs.rs renamed to tests/target/issue-3840/hard-tabs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// rustfmt-hard_tabs: true
2-
// rustfmt-version: Two
32

43
impl<
54
Target: FromEvent<A> + FromEvent<B>,

tests/target/issue-3840/version-two_soft-tabs.rs renamed to tests/target/issue-3840/soft-tabs.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
impl<
42
Target: FromEvent<A> + FromEvent<B>,
53
A: Widget2<Ctx = C>,

tests/target/issue-3882.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
fn bar(_t: T, // bar
32
) {
43
}
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 main() {
42
let checkkwd = (0x2i32 | 0x1i32) as i64; /* unrecognized "\z": print both chars unless ' or " */
53
}

tests/target/long-fn-1/version_two.rs renamed to tests/target/long-fn-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// rustfmt-version: Two
21
// Tests that a function which is almost short enough, but not quite, gets
32
// formatted correctly.
43

tests/target/one_line_if_v2.rs renamed to tests/target/one_line_if.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 plain_if(x: bool) -> u8 {
42
if x { 0 } else { 1 }
53
}

tests/target/single-line-macro/v2.rs renamed to tests/target/single-line-macro.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
// #2652
42
// Preserve trailing comma inside macro, even if it looks an array.
53
macro_rules! bar {

tests/target/trailing_comments/hard_tabs.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-wrap_comments: true
32
// rustfmt-hard_tabs: true
43

tests/target/trailing_comments/soft_tabs.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-wrap_comments: true
32

43
pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast

0 commit comments

Comments
 (0)