Skip to content

Conversation

@Masterchef365
Copy link
Contributor

Mark functions returning Result as #[must_use], so that if the 'out' variable is not mutated, the program is sure to do something about it.

I realized that this case might be important if rsparse is used for e.g. robotic control where the output of e.g. lusol, stored in b here: lusol(a: &Sprs, b: &mut [T], order: i8, tol: T) may not have been touched, and could contain an invalid or otherwise dangerous solution. Previously, this would have been avoided by panicking, but now using Result introduces this possibility.

@RLado
Copy link
Owner

RLado commented Mar 29, 2025

I just learned something new. Thank you!

@RLado RLado merged commit 7a49801 into RLado:master Mar 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants