miracl / core

MIRACL Core
Apache License 2.0
206 stars 68 forks source link

nomut #32

Closed bitdivine closed 3 years ago

bitdivine commented 3 years ago

Changes

This removes the mut keyword from variable definitions and where variables are provided as arguments by reference where the variable or argument is not in fact mutated.

No APIs are changed.

Motivation

I find that it makes code easier to read when the mutability of identifiers is labelled accurately.

I did not read through all the code; after reading through some of it I used cargo clippy to identify unnecessary mut. This is by no means a complete solution but it did identify many cases.

Testing

mcarrickscott commented 3 years ago

Appreciated..