-
Notifications
You must be signed in to change notification settings - Fork 226
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
migrate extern crate
to pub use
#481
Conversation
it's just something i noticed. not sure whether this PR is really worth it... feel free to close it if you prefer to keep |
1e7ae33
to
0673f2f
Compare
there's no need for the `void` dependency anymore. accordingly it can be removed. this will also help with implementing `embedded-hal` v1 traits as some of them rely on (or at least have better support for) `core::convert::Infallible`. this is a breaking change for consumers as they have to e.g. replace `void_unwrap()` calls with `unwrap()`. the prelude is now no longer needed in most cases (potentally the whole `mod prelude` could be removed in the future as it now adds little benefit?). note that this PR will conflict with Rahix#481; when one gets merged i'll have to rebase the other on top of it (though it will be a fairly trivial rebase). this is due to the fact that both modify the same lines in a few places. merging this one here first might be easier as the other one is smaller.
there's no need for the `void` dependency anymore. accordingly it can be removed. this will also help with implementing `embedded-hal` v1 traits as some of them rely on (or at least have better support for) `core::convert::Infallible`. this is a breaking change for consumers as they have to e.g. replace `void_unwrap()` calls with `unwrap()`. the prelude is now no longer needed in most cases (potentally the whole `mod prelude` could be removed in the future as it now adds little benefit?). note that this PR will conflict with Rahix#481; when one gets merged i'll have to rebase the other on top of it (though it will be a fairly trivial rebase). this is due to the fact that both modify the same lines in a few places. merging this one here first might be easier as the other one is smaller.
there's no need for the `void` dependency anymore. accordingly it can be removed. this will also help with implementing `embedded-hal` v1 traits as some of them rely on (or at least have better support for) `core::convert::Infallible`. this is a breaking change for consumers as they have to e.g. replace `void_unwrap()` calls with `unwrap()`. the prelude is now no longer needed in most cases (potentally the whole `mod prelude` could be removed in the future as it now adds little benefit?). note that this PR will conflict with Rahix#481; when one gets merged i'll have to rebase the other on top of it (though it will be a fairly trivial rebase). this is due to the fact that both modify the same lines in a few places. merging this one here first might be easier as the other one is smaller.
👍 on switching to |
`extern crate` is from the old rust 2015 edition. since the 2018 edition `extern crate` is no longer needed. here it was used to re-export certain crates (through `pub extern crate`) which are being referenced mainly in macros (which is why e.g. `paste` is re-exported). this can also be achieved using `pub use`. `avr-hal-generic` internally now has to use `crate::hal` in some cases where it could previously just use `hal` as the renaming is now bound to the usage in the crate and not to the imported crate. in most cases i've just replaced `hal::` usage with `embedded_hal_v0::` usage since it makes it more obvious which e-h version it is about (and in the future `hal` should either be removed or be replaced with e-h v1.0). for external consumers nothing changes.
note: i've explicitly dropped the re-export of `ufmt` as it's not used in this repository* and i don't see `ufmt` as an integral part of these crates. consumers can (and should) just add it as their own dependency. this is a breaking change for consumers which currently do something like `use avr_hal_generic::ufmt`. \* clarification: `ufmt` itself is being used in some places, but the re-export isn't.
7f171b4
to
4f0f4e6
Compare
extern crate
is from the old rust 2015 edition. since the 2018 editionextern crate
is no longer needed.here it was used to re-export certain crates (through
pub extern crate
) which are being referenced mainly in macros (which is why e.g.paste
is re-exported).this can also be achieved using
pub use
.avr-hal-generic
internally now has to usecrate::hal
in some cases where it could previously just usehal
as the renaming is now bound to the usage in the crate and not to the imported crate. in most cases i've just replacedhal::
usage withembedded_hal_v0::
usage since it makes it more obvious which e-h version it is about (and in the futurehal
should either be removed or be replaced with e-h v1.0).note: i've explicitly dropped the re-export of
ufmt
as it's not used in this repository and i don't seeufmt
as an integral part of these crates. consumers can (and should) just add it as their own dependency. this is a breaking change for consumers which currently do something likeuse avr_hal_generic::ufmt
.for external consumers nothing changes besides the removed
ufmt
re-export.