Skip to content

Commit

Permalink
fix: Fix expl_impl_clone_on_copy lint
Browse files Browse the repository at this point in the history
This was being triggered by the derive for EnumSetType, which generates
an item that triggers the lint. It wasn't seen until now due to
[rust-lang/rust-clippy#4612][1], which was only fixed in Rust 1.52.0.

[1]: rust-lang/rust-clippy#4612
  • Loading branch information
connec committed May 17, 2021
1 parent a652d4b commit 9c14a4f
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/change_set.rs
Expand Up @@ -374,28 +374,36 @@ pub enum Replacement {
forward_display_to_serde!(Replacement);
forward_from_str_to_serde!(Replacement);

/// Indicates which resource attribute is triggering this update.
#[derive(Debug, enumset::EnumSetType, serde::Deserialize, serde::Serialize)]
#[enumset(no_ops, serialize_as_list)]
pub enum ModifyScope {
/// A change to the resource's properties.
Properties,
// The derive for EnumSetType creates an item that triggers this lint, so it has to be disabled
// at the module level. We don't want to disable it too broadly though, so we wrap its declaration
// in a module and re-export from that.
mod modify_scope {
#![allow(clippy::expl_impl_clone_on_copy)]

/// A change to the resource's metadata.
Metadata,
/// Indicates which resource attribute is triggering this update.
#[derive(Debug, enumset::EnumSetType, serde::Deserialize, serde::Serialize)]
#[enumset(no_ops, serialize_as_list)]
pub enum ModifyScope {
/// A change to the resource's properties.
Properties,

/// A change to the resource's creation policy.
CreationPolicy,
/// A change to the resource's metadata.
Metadata,

/// A change to the resource's update policy.
UpdatePolicy,
/// A change to the resource's creation policy.
CreationPolicy,

/// A change to the resource's deletion policy.
DeletionPolicy,
/// A change to the resource's update policy.
UpdatePolicy,

/// A change to the resource's tags.
Tags,
/// A change to the resource's deletion policy.
DeletionPolicy,

/// A change to the resource's tags.
Tags,
}
}
pub use modify_scope::ModifyScope;

forward_display_to_serde!(ModifyScope);
forward_from_str_to_serde!(ModifyScope);
Expand Down

0 comments on commit 9c14a4f

Please sign in to comment.