Rollup merge of #58833 - Centril:rust_2018_idioms-rustbook, r=oli-obk

tools/rustbook: deny(rust_2018_idioms)

r? @oli-obk
This commit is contained in:
kennytm 2019-03-02 14:55:22 +08:00
commit 53fc9c6bfa
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -1,4 +1,5 @@
//
#![deny(rust_2018_idioms)]
use clap::{crate_version};
use std::env;
@ -68,7 +69,7 @@ fn main() {
}
// Build command implementation
pub fn build_1(args: &ArgMatches) -> Result1<()> {
pub fn build_1(args: &ArgMatches<'_>) -> Result1<()> {
let book_dir = get_book_dir(args);
let mut book = MDBook1::load(&book_dir)?;
@ -85,7 +86,7 @@ pub fn build_1(args: &ArgMatches) -> Result1<()> {
}
// Build command implementation
pub fn build_2(args: &ArgMatches) -> Result2<()> {
pub fn build_2(args: &ArgMatches<'_>) -> Result2<()> {
let book_dir = get_book_dir(args);
let mut book = MDBook2::load(&book_dir)?;
@ -101,7 +102,7 @@ pub fn build_2(args: &ArgMatches) -> Result2<()> {
Ok(())
}
fn get_book_dir(args: &ArgMatches) -> PathBuf {
fn get_book_dir(args: &ArgMatches<'_>) -> PathBuf {
if let Some(dir) = args.value_of("dir") {
// Check if path is relative from current dir, or absolute...
let p = Path::new(dir);