Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does outer_view return Option instead of Result? #347

Open
ghproek opened this issue May 22, 2024 · 1 comment
Open

Why does outer_view return Option instead of Result? #347

ghproek opened this issue May 22, 2024 · 1 comment

Comments

@ghproek
Copy link

ghproek commented May 22, 2024

I'm building an application that uses sprs for sparse matrices, and I've been debating how to handle errors when the user asks for a row or column that is out of bounds. sprs handles this with an option, but I would have expected a Result, for error handling. I'm inclined to use Result in downstream parts of my own application, but if there's a compelling reason why sprs uses Option instead then I might stick to that for consistency with your package! Thank you!

@mulimoen
Copy link
Collaborator

Guess this is just an oversight or old API which deserves an upgrade. I would suggest for your crate to create a new error type wrapping the None from sprs (see Option::ok_or_else for a simple way of doing this].

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

No branches or pull requests

2 participants