Просмотр исходного кода

Hinting return type rather than making 'em guess.

Dave Gauer 4 лет назад
Родитель
Сommit
a361b90a75
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      18_functions.zig

+ 1 - 1
18_functions.zig

@@ -5,7 +5,7 @@ const std = @import("std");
 
 pub fn main() void {
     // The new function deepThought() should return the number 42. See below.
-    const answer = deepThought();
+    const answer: u8 = deepThought();
     
     std.debug.print("Answer to the Ultimate Question: {}\n", .{answer});
 }