Skip to content

Expose SockAddr::from_raw_sockaddr#1447

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
coolreader18:sockaddr-from-raw
Aug 22, 2021
Merged

Expose SockAddr::from_raw_sockaddr#1447
bors[bot] merged 1 commit intonix-rust:masterfrom
coolreader18:sockaddr-from-raw

Conversation

@coolreader18
Copy link
Copy Markdown
Contributor

I also noticed the SockAddr/InetAddr::to_str functions were entirely redundant - ToString exists for that, & has a blanket impl on T: Display.

Copy link
Copy Markdown
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please split these two changes up, since they're unrelated? Also, it would be good to deprecate to_str for a few releases before removing it entirely.

@coolreader18
Copy link
Copy Markdown
Contributor Author

@asomers Could you take a look at this again? I split out the other change into #1495 as well.

Copy link
Copy Markdown
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot added a commit that referenced this pull request Aug 21, 2021
1447: Expose SockAddr::from_raw_sockaddr r=asomers a=coolreader18

I also noticed the `SockAddr/InetAddr::to_str` functions were entirely redundant - `ToString` exists for that, & has a blanket impl on `T: Display`.


Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Aug 21, 2021

Build failed:

@coolreader18
Copy link
Copy Markdown
Contributor Author

Huh. I think the failure was just cause of the conflict in CHANGELOG?

@asomers
Copy link
Copy Markdown
Member

asomers commented Aug 22, 2021

bors retry

@bors bors bot merged commit 28f547f into nix-rust:master Aug 22, 2021
@coolreader18 coolreader18 deleted the sockaddr-from-raw branch August 22, 2021 01:22
@coolreader18
Copy link
Copy Markdown
Contributor Author

coolreader18 commented Aug 22, 2021

Ah, shoot, just realized the functionality I was looking for was in sockaddr_storage_to_addr - however, I'm pretty sure that should also be unsafe and take a *const sockaddr instead of an &sockaddr_storage, since it seems like there are some assume_init calls that might not be valid as the full extent of the sockaddr_storage might not actually get initialized if the address is only a couple bytes in size. Would that be a reasonable change to make?

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