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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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))?,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))?
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern crate structopt;
extern crate syn;
extern crate walkdir;

use self::format::Pattern;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to this rust-lang/rust#56326.

use self::walkdir::DirEntry;
use self::walkdir::WalkDir;
use cargo::core::compiler::CompileMode;
Expand All @@ -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;
Expand Down