What influences rust's preference for data flow / question about Programming Rust line


Another Rust newcomer here.
Curious about this line in Programming Rust (Chp 5, p.122):

Rust prefers for pointers, ownership, and data flow to pass through the system in one direction…

What idea or design principle establishes this preference? Is this where functional programming principles come through in how you express programs in Rust?


I believe that this is talking about how data is only passed into a function one way, and will not be kept afterwards, given the rules surrounding the dropping of values at the end of every function call. Yes, if I understand the idea of functional programming correctly, then it is similar in that sense.


One-direction data flow is another way of saying that there isn’t any shared mutability.

1 Like

Thanks for these added explanations @OptimisticPeach and @notriddle; adds helpful clarity.