Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: complete rust edition migrations #118

Merged
merged 3 commits into from
Nov 30, 2024
Merged

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Nov 30, 2024

While we switched to Rust 2021 a while ago (and Rust 2018 a while before
that), we still had some older Rust-isms that we could get rid of. So,
going through the Rust edition guides I've done all of the migrations
relevant to libpathrs, which should make the codebase feel a little more
modern.

Signed-off-by: Aleksa Sarai [email protected]

extern crate is no longer needed, and #[macro_use] can be replaced by
importing the macro directly. We already do this for most macros, but
the bitflags usage came from the pre-2018 versions of libpathrs.

Signed-off-by: Aleksa Sarai <[email protected]>
We can now move mod.rs to be <module_name>.rs which is easier to keep
track of. However, in some cases it seemed nicer to remove the mod.rs
file entirely and inline it in the upper module (this is especially nice
for mod.rs files that are completely trivial and just define the list of
submodules -- having to edit separate files is a bit of a waste of
time).

Signed-off-by: Aleksa Sarai <[email protected]>
We don't need to explicitly import it anymore. This is the only explicit
import we had that got added to the prelude in Rust 2021.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar merged commit 0cabef3 into openSUSE:main Nov 30, 2024
49 checks passed
@cyphar cyphar deleted the rust-modern branch November 30, 2024 03:47
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