This repository was archived by the owner on Mar 13, 2025. It is now read-only.
Mutability of functions #9
Jomy10
started this conversation in
Syntax & language features
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Just a thought here:
Just like making a function static by capitalising it, instead of writing
mut func
, a mutable function will be indicated by a!
, like in Ruby, with the difference here that it will be obligatory. So declaring a function that mutates the struct it is called on:The compiler should give warnings when the function doesn't mutate the underlying struct
Beta Was this translation helpful? Give feedback.
All reactions