Skip to content

Rename fallible constructors to use try prefix - #106

Open
lndmrk wants to merge 1 commit into
webrtc:mainfrom
lndmrk:fallible-init
Open

lndmrk wants to merge 1 commit into
webrtc:mainfrom
lndmrk:fallible-init

Conversation

@lndmrk

@lndmrk lndmrk commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

This makes it easier to understand which initializations can fail at the call site.

This makes it easier to understand which initializations can fail at the
call site.
@lndmrk
lndmrk requested a review from boivie March 20, 2026 15:47
Comment thread src/socket/connect.rs
.events
.borrow_mut()
.add(SocketEvent::OnError(ErrorKind::ParseFailed, s.into()));
.add(SocketEvent::OnError(ErrorKind::ParseFailed, s.to_string()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

from into() to to_string() is a bit unrelated to the rest of this commit, and to_string() isn't necessarily the same (it happens to be for this type), as it uses the Display trait. It's fine in this case, though.

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