matrix-org / matrix-ircd

An IRCd implementation backed by Matrix.
Apache License 2.0
224 stars 41 forks source link

GSOC 2020: Code cleanup, Updating dependencies, and moving to rust 2018 idioms #64

Closed VanillaBrooks closed 4 years ago

VanillaBrooks commented 4 years ago

This PR bumps many of the dependencies and updates much of the code to use rust 2018 idioms. This makes reading and reasoning about the code easier, especially in the areas of imports.

Previously, main.rs used the following 2015 syntax:

https://github.com/matrix-org/matrix-ircd/blob/624a5256602af7a88a7e69966e2e38523a970480/src/main.rs#L18-L49

and modules would use macros in the following way:

https://github.com/matrix-org/matrix-ircd/blob/624a5256602af7a88a7e69966e2e38523a970480/src/irc/protocol.rs#L281-L294

Now, the imports are more abbreviated and the function / macro calls throughout the codebase are more explicit as they are now required to be explicitly imported in each file or use module::macro!() syntax. main.rs cargo crate imports are now able to be abbreviated to:

use tokio_core;
use tokio_tls;
use slog_async;
use slog_term;
use url;
use lazy_static;
use clap;
use tasked_futures;
use native_tls;