Ronie
Stochastic thoughts

Wrapping my head around Rust (Part 2)

Sometimes, I factor my code out into functions (or methods) just to find the compiler complains about it.

WHY?

Often, it happens because I try to return an Iterator or other Trait.

I’m still learning, but so far, I got these points about Rust functions:

Rule of thumb, use the Postel’s law: “Be conservative in what you send, be liberal in what you accept”.