1
Fork 0

Cargo fmt and update tests

This commit is contained in:
Seiichi Uchida 2017-12-02 17:45:39 +09:00
parent c4c9bf028a
commit 89f27764ed
20 changed files with 0 additions and 36 deletions

View file

@ -14,7 +14,6 @@ use std::io::Write;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
fn main() { fn main() {
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());

View file

@ -14,7 +14,6 @@ use getopts::{Matches, Options};
use rustfmt::{run, Input}; use rustfmt::{run, Input};
use rustfmt::config; use rustfmt::config;
fn prune_files(files: Vec<&str>) -> Vec<&str> { fn prune_files(files: Vec<&str>) -> Vec<&str> {
let prefixes: Vec<_> = files let prefixes: Vec<_> = files
.iter() .iter()

View file

@ -10,7 +10,6 @@
#![cfg(not(test))] #![cfg(not(test))]
extern crate env_logger; extern crate env_logger;
extern crate getopts; extern crate getopts;
extern crate rustfmt_nightly as rustfmt; extern crate rustfmt_nightly as rustfmt;

View file

@ -824,9 +824,6 @@ impl<'a> Iterator for UngroupedCommentCodeSlices<'a> {
} }
} }
/// Iterator over an alternating sequence of functional and commented parts of /// Iterator over an alternating sequence of functional and commented parts of
/// a string. The first item is always a, possibly zero length, subslice of /// a string. The first item is always a, possibly zero length, subslice of
/// functional text. Line style comments contain their ending newlines. /// functional text. Line style comments contain their ending newlines.
@ -948,7 +945,6 @@ fn changed_comment_content(orig: &str, new: &str) -> bool {
res res
} }
/// Iterator over the 'payload' characters of a comment. /// Iterator over the 'payload' characters of a comment.
/// It skips whitespace, comment start/end marks, and '*' at the beginning of lines. /// It skips whitespace, comment start/end marks, and '*' at the beginning of lines.
/// The comment must be one comment, ie not more than one start mark (no multiple line comments, /// The comment must be one comment, ie not more than one start mark (no multiple line comments,
@ -994,7 +990,6 @@ impl<'a> Iterator for CommentReducer<'a> {
} }
} }
fn remove_comment_header(comment: &str) -> &str { fn remove_comment_header(comment: &str) -> &str {
if comment.starts_with("///") || comment.starts_with("//!") { if comment.starts_with("///") || comment.starts_with("//!") {
&comment[3..] &comment[3..]

View file

@ -21,7 +21,6 @@ use file_lines::FileLines;
use lists::{ListTactic, SeparatorPlace, SeparatorTactic}; use lists::{ListTactic, SeparatorPlace, SeparatorTactic};
use Summary; use Summary;
macro_rules! is_nightly_channel { macro_rules! is_nightly_channel {
() => { () => {
env::var("CFG_RELEASE_CHANNEL") env::var("CFG_RELEASE_CHANNEL")
@ -88,7 +87,6 @@ configuration_option_enum! { TypeDensity:
Wide, Wide,
} }
impl Density { impl Density {
pub fn to_list_tactic(self) -> ListTactic { pub fn to_list_tactic(self) -> ListTactic {
match self { match self {
@ -579,8 +577,6 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
Ok(None) Ok(None)
} }
create_config! { create_config! {
// Fundamental stuff // Fundamental stuff
max_width: usize, 100, true, "Maximum width of each line"; max_width: usize, 100, true, "Maximum width of each line";

View file

@ -13,7 +13,6 @@ use std::cmp::Ordering;
use syntax::ast; use syntax::ast;
use syntax::codemap::{BytePos, Span}; use syntax::codemap::{BytePos, Span};
use spanned::Spanned; use spanned::Spanned;
use codemap::SpanUtils; use codemap::SpanUtils;
use comment::combine_strs_with_missing_comments; use comment::combine_strs_with_missing_comments;

View file

@ -285,7 +285,6 @@ impl<'a> FmtVisitor<'a> {
self.format_item(item); self.format_item(item);
} }
fn format_foreign_item(&mut self, item: &ast::ForeignItem) { fn format_foreign_item(&mut self, item: &ast::ForeignItem) {
let rewrite = item.rewrite(&self.get_context(), self.shape()); let rewrite = item.rewrite(&self.get_context(), self.shape());
self.push_rewrite(item.span(), rewrite); self.push_rewrite(item.span(), rewrite);

View file

@ -18,7 +18,6 @@ use syntax::parse::parser;
use utils::contains_skip; use utils::contains_skip;
/// List all the files containing modules of a crate. /// List all the files containing modules of a crate.
/// If a file is used twice in a crate, it appears only once. /// If a file is used twice in a crate, it appears only once.
pub fn list_files<'a>( pub fn list_files<'a>(

View file

@ -7,28 +7,24 @@ fn main() {
(); ();
} }
'label: loop 'label: loop
// loop comment // loop comment
{ {
(); ();
} }
cond = true; cond = true;
while cond while cond
{ {
(); ();
} }
'while_label: while cond 'while_label: while cond
{ {
// while comment // while comment
(); ();
} }
for obj in iter for obj in iter
{ {
for sub_obj in obj for sub_obj in obj

View file

@ -6,26 +6,22 @@ fn main() {
(); ();
} }
'label: loop 'label: loop
// loop comment // loop comment
{ {
(); ();
} }
cond = true; cond = true;
while cond { while cond {
(); ();
} }
'while_label: while cond { 'while_label: while cond {
// while comment // while comment
(); ();
} }
for obj in iter { for obj in iter {
for sub_obj in obj { for sub_obj in obj {
'nested_while_label: while cond { 'nested_while_label: while cond {

View file

@ -14,10 +14,8 @@ fn main() {
(); ();
} }
let a = if 0 > 1 { unreachable!() } else { 0x0 }; let a = if 0 > 1 { unreachable!() } else { 0x0 };
if true if true
{ {
(); ();

View file

@ -13,10 +13,8 @@ fn main() {
(); ();
} }
let a = if 0 > 1 { unreachable!() } else { 0x0 }; let a = if 0 > 1 { unreachable!() } else { 0x0 };
if true { if true {
(); ();
} else if false { } else if false {

View file

@ -13,10 +13,8 @@ fn main() {
(); ();
} }
let a = if 0 > 1 { unreachable!() } else { 0x0 }; let a = if 0 > 1 { unreachable!() } else { 0x0 };
if true { if true {
(); ();
} }

View file

@ -3,7 +3,6 @@ enum TestEnum {
Arm2, Arm2,
} }
fn foo() { fn foo() {
let test = TestEnum::Arm1; let test = TestEnum::Arm1;
match test { match test {

View file

@ -95,7 +95,6 @@ where
Right { list: I, root: T }, // Post Comment Right { list: I, root: T }, // Post Comment
} }
enum EmtpyWithComment { enum EmtpyWithComment {
// Some comment // Some comment
} }

View file

@ -18,7 +18,6 @@ fn simple(
"cool" "cool"
} }
fn weird_comment( fn weird_comment(
// /*/ double level */ comment // /*/ double level */ comment
x: Hello, // /*/* triple, even */*/ x: Hello, // /*/* triple, even */*/

View file

@ -24,7 +24,6 @@ where
} }
fn foo<U, T>( fn foo<U, T>(
a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,

View file

@ -78,7 +78,6 @@ mod a {
} }
} }
mod b { mod b {
mod a { mod a {
impl Foo { impl Foo {

View file

@ -129,7 +129,6 @@ fn main() {
println!("{}", i); println!("{}", i);
} }
while true { while true {
hello(); hello();
} }

View file

@ -52,7 +52,6 @@ pub type CommentTest<
T, T,
> = (); > = ();
pub type WithWhereClause<LONGPARAMETERNAME, T> pub type WithWhereClause<LONGPARAMETERNAME, T>
where where
T: Clone, T: Clone,