Skip to content

Conversation

@lrazovic
Copy link

@lrazovic lrazovic commented Sep 7, 2021

This PR aims to convert all the possibles functions to const fn in order to be used in other const fn environments, but also includes several changes to cleanup the code. Many of the changed lines of code are due to cargo fmt.

  • Use the include field in Cargo.toml to decrease the crate size by 6% (~2.4 KB).
  • Use the is_err() method in the server example instead of the if let Err(_) syntax.
  • Remove the unused &selfparameter in allow_everyone_connect() function and updated the test to reflect the new syntax. The empty() call can be removed since Endpoint::new() already sets security_attributes to SecurityAttributes::empty()
  • Use .cast() instead of as *mut _. pointer::cast is safer because it cannot accidentally change the pointer’s mutability nor cast the pointer to other types

Changes have been tested on Linux and Windows.

If my observations are wrong I am ready to discuss/change them based on your feedback.

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.

1 participant