Skip to content

Commit 9c14a4f

Browse files
committed
fix: Fix expl_impl_clone_on_copy lint
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
1 parent a652d4b commit 9c14a4f

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

src/change_set.rs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -374,28 +374,36 @@ pub enum Replacement {
374374
forward_display_to_serde!(Replacement);
375375
forward_from_str_to_serde!(Replacement);
376376

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

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

387-
/// A change to the resource's creation policy.
388-
CreationPolicy,
390+
/// A change to the resource's metadata.
391+
Metadata,
389392

390-
/// A change to the resource's update policy.
391-
UpdatePolicy,
393+
/// A change to the resource's creation policy.
394+
CreationPolicy,
392395

393-
/// A change to the resource's deletion policy.
394-
DeletionPolicy,
396+
/// A change to the resource's update policy.
397+
UpdatePolicy,
395398

396-
/// A change to the resource's tags.
397-
Tags,
399+
/// A change to the resource's deletion policy.
400+
DeletionPolicy,
401+
402+
/// A change to the resource's tags.
403+
Tags,
404+
}
398405
}
406+
pub use modify_scope::ModifyScope;
399407

400408
forward_display_to_serde!(ModifyScope);
401409
forward_from_str_to_serde!(ModifyScope);

0 commit comments

Comments
 (0)