Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 22f6869

Browse files
Merge pull request #623 from nicholasbishop/bishop-alloc-cleanup
Minor alloc-related cleanups
2 parents 2f97c5d + 4128922 commit 22f6869

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

‎uefi-test-runner/src/boot/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use uefi::table::boot::{AllocateType, BootServices, MemoryType};
22

3-
use crate::alloc::vec::Vec;
3+
use alloc::vec::Vec;
44

55
pub fn test(bt: &BootServices) {
66
info!("Testing memory functions");

‎uefi/src/data_types/owned_strs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use super::chars::{Char16, NUL_16};
22
use super::strs::{CStr16, FromSliceWithNulError};
3-
use crate::alloc::vec::Vec;
43
use crate::data_types::strs::EqStrUntilNul;
54
use crate::data_types::UnalignedSlice;
65
use crate::polyfill::vec_into_raw_parts;
6+
use alloc::vec::Vec;
77
use core::fmt;
88
use core::ops;
99

@@ -155,8 +155,8 @@ impl<StrType: AsRef<str> + ?Sized> EqStrUntilNul<StrType> for CString16 {
155155
#[cfg(test)]
156156
mod tests {
157157
use super::*;
158-
use crate::alloc::string::String;
159-
use crate::alloc::vec;
158+
use alloc::string::String;
159+
use alloc::vec;
160160

161161
#[test]
162162
fn test_cstring16_from_str() {

‎uefi/src/data_types/strs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ where
478478
#[cfg(test)]
479479
mod tests {
480480
use super::*;
481-
use crate::alloc::string::String;
481+
use alloc::string::String;
482482
use uefi_macros::{cstr16, cstr8};
483483

484484
// Tests if our CStr8 type can be constructed from a valid core::ffi::CStr

‎uefi/src/data_types/unaligned_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::marker::PhantomData;
33
use core::mem::MaybeUninit;
44

55
#[cfg(feature = "alloc")]
6-
use crate::alloc::vec::Vec;
6+
use alloc::vec::Vec;
77

88
/// Slice backed by a potentially-unaligned pointer.
99
///

‎uefi/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
#![deny(clippy::all)]
6969
#![deny(clippy::must_use_candidate)]
7070

71-
// Enable once we use vec![] or similar
72-
// #[cfg_attr(feature = "alloc", macro_use)]
7371
#[cfg(feature = "alloc")]
7472
extern crate alloc;
7573

‎uefi/src/proto/media/file/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ impl FileProtocolInfo for FileSystemVolumeLabel {}
398398
#[cfg(test)]
399399
mod tests {
400400
use super::*;
401-
use crate::alloc::vec;
402401
use crate::table::runtime::TimeParams;
403402
use crate::table::runtime::{Daylight, Time};
404403
use crate::CString16;
404+
use alloc::vec;
405405

406406
fn validate_layout<T: InfoInternal + ?Sized>(info: &T, name: &[Char16]) {
407407
// Check the hardcoded struct alignment.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /