mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-08-03 15:15:37 +00:00
fix: The arguments of the commented out linkElephants call are in the
wrong order to demonstrate the wanted behavior. It is intended to show that the .? operator will panic if it is called on null, but the null elephant is passed as the second argument which may be null (and on which .? is not called).
This commit is contained in:
parent
118c1252be
commit
4f96fa639d
|
@ -38,7 +38,7 @@ pub fn main() void {
|
||||||
// `linkElephants` will stop the program if you try and link an
|
// `linkElephants` will stop the program if you try and link an
|
||||||
// elephant that doesn't exist! Uncomment and see what happens.
|
// elephant that doesn't exist! Uncomment and see what happens.
|
||||||
// const missingElephant: ?*Elephant = null;
|
// const missingElephant: ?*Elephant = null;
|
||||||
// linkElephants(&elephantC, missingElephant);
|
// linkElephants(missingElephant, &elephantC);
|
||||||
|
|
||||||
visitElephants(&elephantA);
|
visitElephants(&elephantA);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user