DEV Community

Discussion on: Learning Rust: Grasping the concepts

Collapse
 
therabak profile image
The-Rabak

Great article, thanks!
I think it could've been a good opportunity to also demonstrate using functions and returning a val from them, especially for fib which is usually done recursively.
Also it might've been a better practice to first break out of the input loop before looping to get the fib value.

Collapse
 
link2twenty profile image
Andrew Bone

A recursive function would have made sense for the Fibonacci sequence, I wanted to play with loops as that's what the lesson seemed to hunt towards but you're absolutely write.

Though remember my solutions are not the definitive answer just the way I happened to solve the problem ☺️