Repository: clap-rs/clap
Pull request #1680 (2020-02-08 14:45:11)

Cut merge commit's messages to the title of the PR


Patch:
diff --git a/benches/01_default.rs b/benches/01_default.rs
index 0d0d4cd1..24e619e6 100644
--- a/benches/01_default.rs
+++ b/benches/01_default.rs
@@ -1,6 +1,10 @@
 #![feature(test)]
 
+extern crate clap;
+extern crate test;
+
 use clap::App;
+
 use test::Bencher;
 
 #[bench]
diff --git a/benches/02_simple.rs b/benches/02_simple.rs
index f41efad4..8722047e 100644
--- a/benches/02_simple.rs
+++ b/benches/02_simple.rs
@@ -1,6 +1,10 @@
 #![feature(test)]
 
+extern crate clap;
+extern crate test;
+
 use clap::{App, Arg};
+
 use test::Bencher;
 
 macro_rules! create_app {
diff --git a/benches/03_complex.rs b/benches/03_complex.rs
index b69a0988..84bbd7be 100644
--- a/benches/03_complex.rs
+++ b/benches/03_complex.rs
@@ -1,5 +1,7 @@
 #![feature(test)]
 
+extern crate test;
+
 use clap::{clap_app, App, AppSettings, Arg, ArgSettings};
 use test::Bencher;
 
diff --git a/benches/04_new_help.rs b/benches/04_new_help.rs
index 5810de6c..1680df5a 100644
--- a/benches/04_new_help.rs
+++ b/benches/04_new_help.rs
@@ -1,9 +1,14 @@
 #![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));
diff --git a/benches/05_ripgrep.rs b/benches/05_ripgrep.rs
index 1e8d571f..695da070 100644
--- a/benches/05_ripgrep.rs
+++ b/benches/05_ripgrep.rs
@@ -5,7 +5,11 @@
 
 #![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;
diff --git a/benches/06_rustup.rs b/benches/06_rustup.rs
index f526af89..05754569 100644
--- a/benches/06_rustup.rs
+++ b/benches/06_rustup.rs
@@ -4,7 +4,11 @@
 
 #![feature(test)]
 
+extern crate clap;
+extern crate test;
+
 use clap::{App, AppSettings, Arg, ArgGroup, ArgSettings};
+
 use test::Bencher;
 
 #[bench]
diff --git a/bors.toml b/bors.toml
index eab5e80d..1cc3ad7a 100644
--- a/bors.toml
+++ b/bors.toml
@@ -9,4 +9,5 @@ pr_status = [
 timeout_sec = 7200
 prerun_timeout_sec = 7200
 delete_merged_branches = true
+cut_body_after = "\n\n"
 block_lables = ["R: blocked", "R: require changes"]
diff --git a/clap_derive/README.md b/clap_derive/README.md
index 2f78df83..ff89f477 100644
--- a/clap_derive/README.md
+++ b/clap_derive/README.md
@@ -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/tree/master/clap_derive/examples) and the [changelog](https://github.com/clap-rs/clap/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_derive/tree/master/examples) and the [changelog](https://github.com/clap-rs/clap_derive/blob/master/CHANGELOG.md).
 
 ## Example
 
@@ -23,6 +23,9 @@ clap = "3"
 
 And then, in your rust file:
 ```rust
+#[macro_use]
+extern crate clap;
+
 use std::path::PathBuf;
 use clap::Clap;
 
diff --git a/clap_derive/src/derives/clap.rs b/clap_derive/src/derives/clap.rs
index bee22813..0367dcf5 100644
--- a/clap_derive/src/derives/clap.rs
+++ b/clap_derive/src/derives/clap.rs
@@ -13,7 +13,6 @@
 // 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};
diff --git a/clap_derive/src/derives/from_argmatches.rs b/clap_derive/src/derives/from_argmatches.rs
index fe12628f..057e638b 100644
--- a/clap_derive/src/derives/from_argmatches.rs
+++ b/clap_derive/src/derives/from_argmatches.rs
@@ -14,9 +14,10 @@
 use std::env;
 
 use proc_macro2;
-use quote::{quote, quote_spanned};
+use syn;
+use syn::punctuated;
 use syn::spanned::Spanned as _;
-use syn::{punctuated, token};
+use syn::token;
 
 use super::{
     spanned::Sp, sub_type, Attrs, Kind, Name, ParserKind, Ty, DEFAULT_CASING, DEFAULT_ENV_CASING,
diff --git a/clap_derive/src/derives/into_app.rs b/clap_derive/src/derives/into_app.rs
index b7949d45..16b3c397 100644
--- a/clap_derive/src/derives/into_app.rs
+++ b/clap_derive/src/derives/into_app.rs
@@ -14,7 +14,6 @@
 use std::env;
 
 use proc_macro2;
-use quote::quote;
 use syn;
 
 use super::{spanned::Sp, Attrs, GenOutput, Name, DEFAULT_CASING, DEFAULT_ENV_CASING};
diff --git a/clap_derive/src/lib.rs b/clap_derive/src/lib.rs
index 78cb3c65..214cdeb6 100644
--- a/clap_derive/src/lib.rs
+++ b/clap_derive/src/lib.rs
@@ -18,9 +18,14 @@
 #![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;
 
diff --git a/examples/01a_quick_example.rs b/examples/01a_quick_example.rs
index 2311bf80..4dd1be9a 100644
--- a/examples/01a_quick_example.rs
+++ b/examples/01a_quick_example.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::App;
 
 fn main() {
diff --git a/examples/01b_quick_example.rs b/examples/01b_quick_example.rs
index 2faf3791..05796e5a 100644
--- a/examples/01b_quick_example.rs
+++ b/examples/01b_quick_example.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/02_apps.rs b/examples/02_apps.rs
index 03555317..29e16e99 100644
--- a/examples/02_apps.rs
+++ b/examples/02_apps.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::App;
 
 fn main() {
diff --git a/examples/03_args.rs b/examples/03_args.rs
index e85c6091..e0274cd3 100644
--- a/examples/03_args.rs
+++ b/examples/03_args.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/04_using_matches.rs b/examples/04_using_matches.rs
index ad6d5c05..64ff929f 100644
--- a/examples/04_using_matches.rs
+++ b/examples/04_using_matches.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/05_flag_args.rs b/examples/05_flag_args.rs
index ea4ada45..f2ebb9da 100644
--- a/examples/05_flag_args.rs
+++ b/examples/05_flag_args.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/06_positional_args.rs b/examples/06_positional_args.rs
index adc0d59d..10b53cd2 100644
--- a/examples/06_positional_args.rs
+++ b/examples/06_positional_args.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/07_option_args.rs b/examples/07_option_args.rs
index 4a7764b7..3ad81f4e 100644
--- a/examples/07_option_args.rs
+++ b/examples/07_option_args.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/08_subcommands.rs b/examples/08_subcommands.rs
index 383ea4cc..dc584edc 100644
--- a/examples/08_subcommands.rs
+++ b/examples/08_subcommands.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/10_default_values.rs b/examples/10_default_values.rs
index 1b975a24..16b5722e 100644
--- a/examples/10_default_values.rs
+++ b/examples/10_default_values.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/11_only_specific_values.rs b/examples/11_only_specific_values.rs
index 05d5cc77..73c6cee3 100644
--- a/examples/11_only_specific_values.rs
+++ b/examples/11_only_specific_values.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/14_groups.rs b/examples/14_groups.rs
index e72da1cc..4a1ea839 100644
--- a/examples/14_groups.rs
+++ b/examples/14_groups.rs
@@ -20,6 +20,8 @@
 /// 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() {
diff --git a/examples/15_custom_validator.rs b/examples/15_custom_validator.rs
index a15161c0..d470b168 100644
--- a/examples/15_custom_validator.rs
+++ b/examples/15_custom_validator.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/16_app_settings.rs b/examples/16_app_settings.rs
index a76c6d0e..2f4ef0c2 100644
--- a/examples/16_app_settings.rs
+++ b/examples/16_app_settings.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, AppSettings};
 
 fn main() {
diff --git a/examples/20_subcommands.rs b/examples/20_subcommands.rs
index 36657904..b0d4b562 100644
--- a/examples/20_subcommands.rs
+++ b/examples/20_subcommands.rs
@@ -39,6 +39,8 @@
 // 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() {
diff --git a/examples/21_aliases.rs b/examples/21_aliases.rs
index bd5b0034..1fd4b724 100644
--- a/examples/21_aliases.rs
+++ b/examples/21_aliases.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 fn main() {
diff --git a/examples/22_stop_parsing_with_--.rs b/examples/22_stop_parsing_with_--.rs
index 9e63a0ed..bb0e4fa1 100644
--- a/examples/22_stop_parsing_with_--.rs
+++ b/examples/22_stop_parsing_with_--.rs
@@ -1,3 +1,5 @@
+extern crate clap;
+
 use clap::{App, Arg};
 
 /// myprog -f -p=bob -- sloppy slop slop
diff --git a/src/lib.rs b/src/lib.rs
index 77411fb1..300c292e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -186,6 +186,7 @@
 //! //
 //! // 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() {


Test patch:
diff --git a/clap_derive/tests/deny-warnings.rs b/clap_derive/tests/deny-warnings.rs
index 75e88765..68643752 100644
--- a/clap_derive/tests/deny-warnings.rs
+++ b/clap_derive/tests/deny-warnings.rs
@@ -14,6 +14,8 @@
 
 #![deny(warnings)]
 
+extern crate clap;
+
 use clap::Clap;
 
 fn try_str(s: &str) -> Result<String, std::convert::Infallible> {
diff --git a/clap_derive/tests/utils.rs b/clap_derive/tests/utils.rs
index 8d39a273..dd8e8a93 100644
--- a/clap_derive/tests/utils.rs
+++ b/clap_derive/tests/utils.rs
@@ -1,3 +1,6 @@
+#![allow(unused)]
+extern crate clap;
+
 use clap::IntoApp;
 
 pub fn get_help<T: IntoApp>() -> String {