1679: Remove extern & macro_use where possible r=CreepySkeleton a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This commit is contained in:
bors[bot] 2020-02-08 14:37:29 +00:00 committed by GitHub
commit 6f4246ef01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 8 additions and 78 deletions

View file

@ -1,10 +1,6 @@
#![feature(test)]
extern crate clap;
extern crate test;
use clap::App;
use test::Bencher;
#[bench]

View file

@ -1,10 +1,6 @@
#![feature(test)]
extern crate clap;
extern crate test;
use clap::{App, Arg};
use test::Bencher;
macro_rules! create_app {

View file

@ -1,7 +1,5 @@
#![feature(test)]
extern crate test;
use clap::{clap_app, App, AppSettings, Arg, ArgSettings};
use test::Bencher;

View file

@ -1,14 +1,9 @@
#![feature(test)]
extern crate clap;
extern crate test;
use test::Bencher;
use std::io::Cursor;
use clap::App;
use clap::{Arg, ArgSettings};
use std::io::Cursor;
use test::Bencher;
fn build_help(app: &mut App) -> String {
let mut buf = Cursor::new(Vec::with_capacity(50));

View file

@ -5,11 +5,7 @@
#![feature(test)]
extern crate clap;
extern crate test;
use clap::{App, AppSettings, Arg, ArgSettings};
use std::collections::HashMap;
use std::io::Cursor;
use test::Bencher;

View file

@ -4,11 +4,7 @@
#![feature(test)]
extern crate clap;
extern crate test;
use clap::{App, AppSettings, Arg, ArgGroup, ArgSettings};
use test::Bencher;
#[bench]

View file

@ -10,7 +10,7 @@ consumers.
## Documentation
Find it on [Docs.rs](https://docs.rs/clap_derive). You can also check the [examples](https://github.com/clap-rs/clap_derive/tree/master/examples) and the [changelog](https://github.com/clap-rs/clap_derive/blob/master/CHANGELOG.md).
Find it on [Docs.rs](https://docs.rs/clap_derive). You can also check the [examples](https://github.com/clap-rs/clap/tree/master/clap_derive/examples) and the [changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md).
## Example
@ -23,9 +23,6 @@ clap = "3"
And then, in your rust file:
```rust
#[macro_use]
extern crate clap;
use std::path::PathBuf;
use clap::Clap;

View file

@ -13,6 +13,7 @@
// MIT/Apache 2.0 license.
use proc_macro2::Span;
use proc_macro_error::{abort, abort_call_site, set_dummy};
use quote::{quote, quote_spanned};
use syn::{self, punctuated, spanned::Spanned, token, FieldsUnnamed, Ident};
use super::{from_argmatches, into_app, sub_type, Attrs, Kind, Name, ParserKind, Ty};

View file

@ -14,10 +14,9 @@
use std::env;
use proc_macro2;
use syn;
use syn::punctuated;
use quote::{quote, quote_spanned};
use syn::spanned::Spanned as _;
use syn::token;
use syn::{punctuated, token};
use super::{
spanned::Sp, sub_type, Attrs, Kind, Name, ParserKind, Ty, DEFAULT_CASING, DEFAULT_ENV_CASING,

View file

@ -14,6 +14,7 @@
use std::env;
use proc_macro2;
use quote::quote;
use syn;
use super::{spanned::Sp, Attrs, GenOutput, Name, DEFAULT_CASING, DEFAULT_ENV_CASING};

View file

@ -18,14 +18,9 @@
#![recursion_limit = "256"]
extern crate proc_macro;
extern crate syn;
#[macro_use]
extern crate quote;
extern crate heck;
extern crate proc_macro2;
extern crate proc_macro_error;
use proc_macro_error::proc_macro_error;
use syn;
mod derives;

View file

@ -14,8 +14,6 @@
#![deny(warnings)]
extern crate clap;
use clap::Clap;
fn try_str(s: &str) -> Result<String, std::convert::Infallible> {

View file

@ -1,6 +1,3 @@
#![allow(unused)]
extern crate clap;
use clap::IntoApp;
pub fn get_help<T: IntoApp>() -> String {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::App;
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::App;
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -20,8 +20,6 @@
/// of the three numbers. So you create three flags `--major`, `--minor`, and `--patch`. All of
/// these arguments shouldn't be used at one time but you want to specify that *at least one* of
/// them is used. For this, you can create a group.
extern crate clap;
use clap::{App, Arg, ArgGroup};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, AppSettings};
fn main() {

View file

@ -39,8 +39,6 @@
// Let's make a quick program to illustrate. We'll be using the same example as above but for
// brevity sake we won't implement all of the subcommands, only a few.
extern crate clap;
use clap::{App, AppSettings, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
fn main() {

View file

@ -1,5 +1,3 @@
extern crate clap;
use clap::{App, Arg};
/// myprog -f -p=bob -- sloppy slop slop

View file

@ -186,7 +186,6 @@
//! //
//! // This example demonstrates clap's building from YAML style of creating arguments which is far
//! // more clean, but takes a very small performance hit compared to the other two methods.
//! #[macro_use]
//! use clap::App;
//!
//! fn main() {