deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

rename strum::EnumProperty to avoid name conflict

Open picoHz opened this issue 1 year ago • 0 comments

My project uses deltachat-core-rust as a dependency and I encountered a build error in a specific situation. When some crates in the dependency tree enables derive feature in strum crate, the following error occurs:

error[E0252]: the name `EnumProperty` is defined multiple times
 --> /home/picoHz/.cargo/git/checkouts/deltachat-core-rust-632648ad67f90089/50e53f2/src/config.rs:5:49
  |
4 | use strum::{EnumProperty, IntoEnumIterator};
  |             ------------ previous import of the macro `EnumProperty` here
5 | use strum_macros::{AsRefStr, Display, EnumIter, EnumProperty, EnumString};
  |                                                 ^^^^^^^^^^^^--
  |                                                 |
  |                                                 `EnumProperty` reimported here
  |                                                 help: remove unnecessary import
  |
  = note: `EnumProperty` must be defined only once in the macro namespace of this module

error[E0252]: the name `EnumProperty` is defined multiple times
 --> /home/picoHz/.cargo/git/checkouts/deltachat-core-rust-632648ad67f90089/50e53f2/src/stock_str.rs:8:5       
  |
7 | use strum::EnumProperty;
  |     ------------------- previous import of the macro `EnumProperty` here
8 | use strum_macros::EnumProperty;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ `EnumProperty` reimported here
  |
  = note: `EnumProperty` must be defined only once in the macro namespace of this module

This issue is hard to fix when the dependency tree is complicated, so I made this PR to avoid the error.

picoHz avatar Aug 09 '22 00:08 picoHz