mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-09 16:39:58 +00:00
Converted var to const if there is no mutation in var.
This is checked from compiler version 0.12.0-dev.1664
This commit is contained in:
@@ -24,7 +24,7 @@ const Elephant = struct {
|
||||
|
||||
pub fn print(self: *Elephant) void {
|
||||
// Prints elephant letter and [v]isited
|
||||
var v: u8 = if (self.visited) 'v' else ' ';
|
||||
const v: u8 = if (self.visited) 'v' else ' ';
|
||||
std.debug.print("{u}{u} ", .{ self.letter, v });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user