Skip to content

Commit

Permalink
uefi_std: Remove core prelude items
Browse files Browse the repository at this point in the history
The core prelude is automatically available in all crates and does not
need to be re-exported.

Leave the alloc re-exports that are available from the std prelude, as
the std prelude is not available but these types are commonly used in
Rust code.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Jun 10, 2024
1 parent 8e768fc commit 45dc3de
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions crates/uefi_std/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
pub use uefi::prelude::*;

/* This section was addapted from the Rust Standard Library, and is licensed accordingly
* https://raw.githubusercontent.com/rust-lang/rust/master/src/libstd/prelude/v1.rs
* {
*/

// Re-exported core operators
#[doc(no_inline)]
pub use core::marker::{Send, Sized, Sync, Unpin};
#[doc(no_inline)]
pub use core::ops::{Drop, Fn, FnMut, FnOnce};

// Re-exported functions
#[doc(no_inline)]
pub use core::mem::drop;

// Re-exported types and traits
#[doc(no_inline)]
pub use core::convert::{AsMut, AsRef, From, Into};
#[doc(no_inline)]
pub use core::iter::{DoubleEndedIterator, ExactSizeIterator};
#[doc(no_inline)]
pub use core::iter::{Extend, IntoIterator, Iterator};
#[doc(no_inline)]
pub use core::option::Option::{self, None, Some};

// The file so far is equivalent to src/libcore/prelude/v1.rs,
// and below to src/liballoc/prelude.rs.
// Those files are duplicated rather than using glob imports
// because we want docs to show these re-exports as pointing to within `std`.
// These common items exist in alloc and are exported by the std prelude.
// https://doc.rust-lang.org/stable/std/prelude/index.html

#[doc(no_inline)]
pub use alloc_crate::borrow::ToOwned;
Expand All @@ -42,5 +15,3 @@ pub use alloc_crate::string::{String, ToString};
pub use alloc_crate::vec;
#[doc(no_inline)]
pub use alloc_crate::vec::Vec;

/* } */

0 comments on commit 45dc3de

Please sign in to comment.