Skip to content

Commit df7bc4e

Browse files
committed
fix nightly clippy warnings
Note that this still compiles warning-free with rustc 1.70.
1 parent 9ef4080 commit df7bc4e

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[lib]
9-
proc_macro = true
9+
proc-macro = true
1010

1111
[dependencies]
1212
proc-macro2 = "1.0.81"

derive/src/argument.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use crate::{
1313
pub struct Argument {
1414
pub ident: Ident,
1515
pub field: Option<syn::Type>,
16-
pub name: String,
1716
pub arg_type: ArgType,
1817
pub help: String,
1918
}
@@ -41,7 +40,6 @@ pub fn parse_arguments_attr(attrs: &[Attribute]) -> ArgumentsAttr {
4140

4241
pub fn parse_argument(v: Variant) -> Vec<Argument> {
4342
let ident = v.ident;
44-
let name = ident.to_string();
4543
let attributes = get_arg_attributes(&v.attrs).unwrap();
4644

4745
// Return early because we don't need to check the fields if it's not used.
@@ -94,7 +92,6 @@ pub fn parse_argument(v: Variant) -> Vec<Argument> {
9492
Argument {
9593
ident: ident.clone(),
9694
field: field.clone(),
97-
name: name.clone(),
9895
arg_type,
9996
help: arg_help,
10097
}

tests/options.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fn actions() {
286286
fn apply(&mut self, arg: Arg) {
287287
match arg {
288288
Arg::Message(m) => {
289-
self.last_message = m.clone();
289+
self.last_message.clone_from(&m);
290290
self.messages.push(m);
291291
}
292292
Arg::Send => self.send = true,
@@ -617,6 +617,7 @@ fn empty_value() {
617617
Val(V),
618618
}
619619

620+
#[allow(dead_code)]
620621
struct Settings {}
621622

622623
impl Options<Arg> for Settings {

0 commit comments

Comments
 (0)