Commit 2a93b52e9f

2a93b52e9ff869fc1b69ab8876bdb5002577b37e

parent: 799862c106

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-06-27 12:56 UTC

config: Use ranges to declare the min/max integer option values.

Layout: unified · split

src/config.rs +2 −3
@@ -171,7 +171,7 @@ macro_rules! option {
171 option_getter!(Boolean, $option_name, bool); 171 option_getter!(Boolean, $option_name, bool);
172 }; 172 };
173 173
174 (Integer, $option_name:ident, $description:literal, $default:literal, $min:literal, $max:literal) => { 174 (Integer, $option_name:ident, $description:literal, $default:literal, $min:literal..$max:literal) => {
175 integer_create!($option_name, $description, $default, $min, $max, []); 175 integer_create!($option_name, $description, $default, $min, $max, []);
176 option_getter!(Integer, $option_name, i64); 176 option_getter!(Integer, $option_name, i64);
177 }; 177 };
@@ -303,8 +303,7 @@ config!(
303 int_test: Integer { 303 int_test: Integer {
304 "test", 304 "test",
305 5, 305 5,
306 0, 306 0..10
307 10
308 }, 307 },
309 enum_test: Enum { 308 enum_test: Enum {
310 "test", 309 "test",