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

local_addr should not return an Option #11

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

dpc
Copy link
Contributor

@dpc dpc commented Sep 9, 2023

I applied your GH suggestion without actually checking, and I think this was your actual intention all along.

@ibraheemdev
Copy link
Owner

Ah it seems I missed the point of the Option and Result. The None case isn't really an IO error, so merging it into one is a little odd. I'm open to your thoughts on this and don't have a strong preference.

@dpc
Copy link
Contributor Author

dpc commented Sep 10, 2023

I don't think it matters much one way or another. Barely anyone actually need this call, and if they do, they know they just called bind anyway.

Nested Option<Result<_>> is just not very convenient. Otherwise people can just ? if they want bubble up, or .expect if they want to panic. I think the way it is in this PR is totally fine.

@ibraheemdev
Copy link
Owner

Sounds good, thanks!

@ibraheemdev ibraheemdev merged commit e634196 into ibraheemdev:master Sep 11, 2023
5 checks 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.

None yet

2 participants