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

Use Rust 2018 edition #40

Merged
merged 2 commits into from Dec 26, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Some generated files are not rendered by default. Learn more.

@@ -2,6 +2,7 @@
name = "cargo-geiger"
description = "Detects usage of unsafe Rust in your project and its dependencies."
version = "0.4.2"
edition = "2018"
authors = ["anderejd <rajder@gmail.com>"]
repository = "https://github.com/anderejd/cargo-geiger"
readme = "README.md"
@@ -3,7 +3,7 @@ use cargo::core::PackageId;
use std::error::Error;
use std::fmt;

use format::parse::{Parser, RawChunk};
use self::parse::{Parser, RawChunk};

mod parse;

@@ -60,16 +60,16 @@ impl<'a> fmt::Display for Display<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
for chunk in &self.pattern.0 {
match *chunk {
Chunk::Raw(ref s) => try!(fmt.write_str(s)),
Chunk::Package => try!(write!(fmt, "{}", self.package)),
Chunk::Raw(ref s) => (fmt.write_str(s))?,

This comment has been minimized.

Copy link
@jiminhsieh

jiminhsieh Dec 26, 2018

Author Contributor

try! was deprecated, so I use ? to replace.

Chunk::Package => (write!(fmt, "{}", self.package))?,
Chunk::License => {
if let Some(ref license) = self.metadata.license {
try!(write!(fmt, "{}", license))
(write!(fmt, "{}", license))?
}
}
Chunk::Repository => {
if let Some(ref repository) = self.metadata.repository {
try!(write!(fmt, "{}", repository))
(write!(fmt, "{}", repository))?
}
}
}
@@ -12,6 +12,7 @@ extern crate structopt;
extern crate syn;
extern crate walkdir;

use self::format::Pattern;

This comment has been minimized.

Copy link
@jiminhsieh

jiminhsieh Dec 26, 2018

Author Contributor

Due to this rust-lang/rust#56326.

use self::walkdir::DirEntry;
use self::walkdir::WalkDir;
use cargo::core::compiler::CompileMode;
@@ -32,7 +33,6 @@ use cargo::util::ProcessBuilder;
use cargo::util::{self, important_paths, CargoResult, Cfg};
use cargo::Config;
use colored::*;
use format::Pattern;
use petgraph::graph::NodeIndex;
use petgraph::visit::EdgeRef;
use petgraph::EdgeDirection;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.