GuillaumeGomez / rust-GSL

A GSL (the GNU Scientific Library) binding for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforcing rust mutability rules ?

elinorbgr opened this issue · comments

Hi, I just started to look at this library planning to probably use it for some projects.

From what I see, for example VectorF32::set(..) takes a &self reference, while according to rust mutability rules, you would expect it to require a &mut self reference. There are a lot of similar situations all around the binding.

Is it intended ?
(If not, I could maybe start working on fixing it everywhere appropriate, if I find some time.)

I did it at my beginnings because I had a warning about useless mutability. So this is half intended. I didn't get back to it since then. It would be very nice if you did correct it !

I don't think this can be closed yet, as there are other types (besides matrix/vectors) and functions that need some references to be changed to &mut, I'll be changing them exhaustively but the library is large so it may take a while if we don't want to miss any.

That's because your comment had "fixes #7". I reopen it.

Fixed by #41 and #43.