Skip to content

Commit

Permalink
fix nightly clippy warnings
Browse files Browse the repository at this point in the history
Note that this still compiles warning-free with rustc 1.70.
  • Loading branch information
BenWiederhake committed May 9, 2024
1 parent 9ef4080 commit df7bc4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
proc_macro = true
proc-macro = true

[dependencies]
proc-macro2 = "1.0.81"
Expand Down
3 changes: 0 additions & 3 deletions derive/src/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::{
pub struct Argument {
pub ident: Ident,
pub field: Option<syn::Type>,
pub name: String,
pub arg_type: ArgType,
pub help: String,
}
Expand Down Expand Up @@ -41,7 +40,6 @@ pub fn parse_arguments_attr(attrs: &[Attribute]) -> ArgumentsAttr {

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

// Return early because we don't need to check the fields if it's not used.
Expand Down Expand Up @@ -94,7 +92,6 @@ pub fn parse_argument(v: Variant) -> Vec<Argument> {
Argument {
ident: ident.clone(),
field: field.clone(),
name: name.clone(),
arg_type,
help: arg_help,
}
Expand Down
3 changes: 2 additions & 1 deletion tests/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ fn actions() {
fn apply(&mut self, arg: Arg) {
match arg {
Arg::Message(m) => {
self.last_message = m.clone();
self.last_message.clone_from(&m);
self.messages.push(m);
}
Arg::Send => self.send = true,
Expand Down Expand Up @@ -617,6 +617,7 @@ fn empty_value() {
Val(V),
}

#[allow(dead_code)]
struct Settings {}

impl Options<Arg> for Settings {
Expand Down

0 comments on commit df7bc4e

Please sign in to comment.