arcstr
arcstr copied to clipboard
Clippy warning on const ArcStr literal
I am getting the following clippy warning when using const ArcStr literals. IMO these warnings are harmless. It's probably a good idea to silence such warnings in arcstr::literal
macro.
warning: a `const` item should never be interior mutable
--> src/regex.rs:305:1
|
305 | pub const SPACE: ArcStr = arcstr::literal!(" ");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
= note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
warning: a `const` item with interior mutability should not be borrowed
--> src/tracer/state.rs:231:22
|
231 | let space = &SPACE;
| ^^^^^
|
= help: assign this const to a local or static variable, and use the variable here
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const
= note: `#[warn(clippy::borrow_interior_mutable_const)]` on by default