Skip to content

Commit 71a4217

Browse files
committed
use let to bind value from a macro expression
1 parent 75ecd60 commit 71a4217

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/config/config_type.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,10 @@ macro_rules! create_config {
324324
#[allow(unreachable_pub)]
325325
/// Returns `true` if the config key was explicitly set and is the default value.
326326
pub fn is_default(&self, key: &str) -> bool {
327+
let default = $def;
327328
match key {
328329
$(
329-
stringify!($i) => self.$i.1 && self.$i.2 == $def,
330+
stringify!($i) => self.$i.1 && self.$i.2 == default,
330331
)+
331332
_ => false,
332333
}

0 commit comments

Comments
 (0)