We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90f24de commit 532eacbCopy full SHA for 532eacb
uefi/src/mem/aligned_buffer.rs
@@ -47,7 +47,7 @@ impl AlignedBuffer {
47
48
/// Get a mutable pointer to the aligned memory region managed by this instance.
49
#[must_use]
50
- pub fn ptr_mut(&mut self) -> *mut u8 {
+ pub constfn ptr_mut(&mut self) -> *mut u8 {
51
self.ptr.as_ptr()
52
}
53
uefi/src/mem/memory_map/impl_.rs
@@ -335,7 +335,7 @@ impl MemoryMapBackingMemory {
335
336
/// Returns a mutable slice to the underlying memory.
337
338
- pub fn as_mut_slice(&mut self) -> &mut [u8] {
+ pub constfn as_mut_slice(&mut self) -> &mut [u8] {
339
unsafe { self.0.as_mut() }
340
341
uefi/src/proto/ata/pass_thru.rs
@@ -105,7 +105,7 @@ pub struct AtaDevice<'a> {
105
106
107
impl AtaDevice<'_> {
108
- fn proto_mut(&mut self) -> *mut AtaPassThruProtocol {
+ constfn proto_mut(&mut self) -> *mut AtaPassThruProtocol {
109
ptr::from_ref(self.proto).cast_mut()
110
111
uefi/src/proto/console/gop.rs
@@ -569,7 +569,7 @@ impl FrameBuffer<'_> {
569
///
570
/// On some implementations this framebuffer pointer can be used after
571
/// exiting boot services, but that is not guaranteed by the UEFI Specification.
572
- pub fn as_mut_ptr(&mut self) -> *mut u8 {
+ pub constfn as_mut_ptr(&mut self) -> *mut u8 {
573
self.base
574
575
uefi/src/proto/console/text/output.rs
@@ -72,7 +72,7 @@ impl Output {
72
73
/// Returns an iterator of all supported text modes.
74
// TODO: Bring back impl Trait once the story around bounds improves
75
- pub fn modes(&mut self) -> OutputModeIter<'_> {
+ pub constfn modes(&mut self) -> OutputModeIter<'_> {
76
let max = self.data().max_mode as usize;
77
OutputModeIter {
78
output: self,
uefi/src/proto/device_path/build.rs
@@ -79,7 +79,7 @@ pub struct DevicePathBuilder<'a> {
79
80
impl<'a> DevicePathBuilder<'a> {
81
/// Create a builder backed by a statically-sized buffer.
82
- pub fn with_buf(buf: &'a mut [MaybeUninit<u8>]) -> Self {
+ pub constfn with_buf(buf: &'a mut [MaybeUninit<u8>]) -> Self {
83
Self {
84
storage: BuilderStorage::Buf { buf, offset: 0 },
85
uefi/src/proto/loaded_image.rs
@@ -131,7 +131,7 @@ impl LoadedImage {
131
/// long enough.
132
133
/// [shim]: https://github.com/rhboot/shim/blob/4d64389c6c941d21548b06423b8131c872e3c3c7/pe.c#L1143
134
- pub unsafe fn set_image(&mut self, data: *const c_void, size: u64) {
+ pub constunsafe fn set_image(&mut self, data: *const c_void, size: u64) {
135
self.0.image_base = data;
136
self.0.image_size = size;
137
@@ -167,7 +167,7 @@ impl LoadedImage {
167
/// must ensure that the memory lives long enough.
168
169
/// [`boot::start_image`]: crate::boot::start_image
170
- pub unsafe fn set_load_options(&mut self, options: *const u8, size: u32) {
+ pub constunsafe fn set_load_options(&mut self, options: *const u8, size: u32) {
171
self.0.load_options = options.cast();
172
self.0.load_options_size = size;
173
uefi/src/proto/network/mod.rs
@@ -58,7 +58,7 @@ impl IpAddress {
58
59
60
61
- fn as_raw_ptr_mut(&mut self) -> *mut uefi_raw::IpAddress {
+ constfn as_raw_ptr_mut(&mut self) -> *mut uefi_raw::IpAddress {
62
// The uefi-raw type is defined differently, but the layout is
63
// compatible.
64
self.0.as_mut_ptr().cast()
uefi/src/proto/nvme/pass_thru.rs
@@ -119,7 +119,7 @@ pub struct NvmeNamespace<'a> {
119
120
121
impl NvmeNamespace<'_> {
122
- fn proto_mut(&mut self) -> *mut NvmExpressPassThruProtocol {
+ constfn proto_mut(&mut self) -> *mut NvmExpressPassThruProtocol {
123
124
125
uefi/src/proto/scsi/pass_thru.rs
@@ -130,7 +130,7 @@ pub struct ScsiDevice<'a> {
130
target_lun: ScsiTargetLun,
impl ScsiDevice<'_> {
- fn proto_mut(&mut self) -> *mut ExtScsiPassThruProtocol {
+ constfn proto_mut(&mut self) -> *mut ExtScsiPassThruProtocol {
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments