Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Rust 2018 #168

Merged
merged 1 commit into from Apr 5, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+18 −15
Diff settings

Always

Just for now

@@ -8,6 +8,7 @@ name = "rustfix"
description = "Automatically apply the suggestions made by rustc"
repository = "https://github.com/rust-lang-nursery/rustfix"
documentation = "https://docs.rs/rustfix"
edition = "2018"
readme = "Readme.md"
version = "0.4.4"
exclude = [
@@ -1,5 +1,5 @@
extern crate failure;
extern crate rustfix;

use rustfix;

use failure::Error;
use std::io::{stdin, BufReader, Read};
@@ -1,3 +1,5 @@
#![warn(rust_2018_idioms)]

#[macro_use]
extern crate log;
#[macro_use]
@@ -7,15 +9,15 @@ extern crate failure;
extern crate proptest;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
use serde_json;

use std::collections::HashSet;
use std::ops::Range;

use failure::Error;

pub mod diagnostics;
use diagnostics::{Diagnostic, DiagnosticSpan};
use crate::diagnostics::{Diagnostic, DiagnosticSpan};
mod replace;

#[derive(Debug, Clone, Copy)]
@@ -44,7 +46,7 @@ pub struct LinePosition {
}

impl std::fmt::Display for LinePosition {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}:{}", self.line, self.column)
}
}
@@ -56,7 +58,7 @@ pub struct LineRange {
}

impl std::fmt::Display for LineRange {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}-{}", self.start, self.end)
}
}
@@ -178,8 +180,8 @@ pub fn collect_suggestions<S: ::std::hash::BuildHasher>(
.spans
.iter()
.filter(|span| {
use Filter::*;
use diagnostics::Applicability::*;
use crate::Filter::*;
use crate::diagnostics::Applicability::*;

match (filter, &span.suggestion_applicability) {
(MachineApplicableOnly, Some(MachineApplicable)) => true,
@@ -1,4 +1,4 @@
extern crate rustfix;
use rustfix;
use std::collections::HashSet;
use std::fs;

@@ -1,15 +1,15 @@
#![cfg(not(windows))] // TODO: should fix these tests on Windows

extern crate duct;
extern crate env_logger;
use duct;
use env_logger;
#[macro_use]
extern crate log;
extern crate rustfix;
extern crate serde_json;
extern crate tempdir;
use rustfix;


#[macro_use]
extern crate failure;
extern crate difference;


use std::collections::HashSet;
use std::ffi::OsString;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.