Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to convert all the possibles functions to
const fn
in order to be used in otherconst fn
environments, but also includes several changes to cleanup the code. Many of the changed lines of code are due tocargo fmt
.include
field inCargo.toml
to decrease the crate size by 6% (~2.4 KB).is_err()
method in the server example instead of theif let Err(_)
syntax.&self
parameter inallow_everyone_connect()
function and updated the test to reflect the new syntax. Theempty()
call can be removed sinceEndpoint::new()
already setssecurity_attributes
toSecurityAttributes::empty()
.cast()
instead ofas *mut _
.pointer::cast
is safer because it cannot accidentally change the pointer’s mutability nor cast the pointer to other typesChanges have been tested on Linux and Windows.
If my observations are wrong I am ready to discuss/change them based on your feedback.