We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1a9b079 + 8f4ec64 commit da737dcCopy full SHA for da737dc
chalk-macros/src/index.rs
@@ -15,7 +15,7 @@ macro_rules! index_struct {
15
#[allow(dead_code)]
16
$v fn get_and_increment(&mut self) -> Self {
17
let old_value = *self;
18
- self.value += 1;
+ self.increment();
19
old_value
20
}
21
@@ -31,14 +31,14 @@ macro_rules! index_struct {
31
32
33
impl ::std::fmt::Debug for $n {
34
- fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
+ fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
35
write!(fmt, "{}({})", stringify!($n), self.value)
36
37
38
39
impl From<usize> for $n {
40
fn from(value: usize) -> Self {
41
- Self { value: value }
+ Self { value }
42
43
44
0 commit comments