Skip to content

Commit

Permalink
kill some of the new nightly warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Feb 20, 2024
1 parent 2576fbd commit d03f4e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions capnp/src/any_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

//! Untyped pointer that can be cast to any struct, list, or capability type.

#[cfg(feature = "alloc")]
use alloc::{boxed::Box, vec::Vec};

#[cfg(feature = "alloc")]
use crate::capability::FromClientHook;
#[cfg(feature = "alloc")]
Expand Down Expand Up @@ -83,7 +80,10 @@ impl<'a> Reader<'a> {
//# Used by RPC system to implement pipelining. Applications
//# generally shouldn't use this directly.
#[cfg(feature = "alloc")]
pub fn get_pipelined_cap(&self, ops: &[PipelineOp]) -> Result<Box<dyn ClientHook>> {
pub fn get_pipelined_cap(
&self,
ops: &[PipelineOp],
) -> Result<alloc::boxed::Box<dyn ClientHook>> {
let mut pointer = self.reader;

for op in ops {
Expand Down Expand Up @@ -172,7 +172,7 @@ impl<'a> Builder<'a> {

// XXX value should be a user client.
#[cfg(feature = "alloc")]
pub fn set_as_capability(&mut self, value: Box<dyn ClientHook>) {
pub fn set_as_capability(&mut self, value: alloc::boxed::Box<dyn ClientHook>) {
self.builder.set_capability(value);
}

Expand Down Expand Up @@ -217,18 +217,18 @@ impl<'a> crate::traits::ImbueMut<'a> for Builder<'a> {
pub struct Pipeline {
// XXX this should not be public
#[cfg(feature = "alloc")]
pub hook: Box<dyn PipelineHook>,
pub hook: alloc::boxed::Box<dyn PipelineHook>,

#[cfg(feature = "alloc")]
ops: Vec<PipelineOp>,
ops: alloc::vec::Vec<PipelineOp>,
}

impl Pipeline {
#[cfg(feature = "alloc")]
pub fn new(hook: Box<dyn PipelineHook>) -> Self {
pub fn new(hook: alloc::boxed::Box<dyn PipelineHook>) -> Self {
Self {
hook,
ops: Vec::new(),
ops: alloc::vec::Vec::new(),
}
}

Expand All @@ -247,7 +247,7 @@ impl Pipeline {

#[cfg(feature = "alloc")]
pub fn get_pointer_field(&self, pointer_index: u16) -> Self {
let mut new_ops = Vec::with_capacity(self.ops.len() + 1);
let mut new_ops = alloc::vec::Vec::with_capacity(self.ops.len() + 1);
for op in &self.ops {
new_ops.push(*op)
}
Expand All @@ -264,7 +264,7 @@ impl Pipeline {
}

#[cfg(feature = "alloc")]
pub fn as_cap(&self) -> Box<dyn ClientHook> {
pub fn as_cap(&self) -> alloc::boxed::Box<dyn ClientHook> {
self.hook.get_pipelined_cap(&self.ops)
}
}
Expand Down Expand Up @@ -304,7 +304,7 @@ fn init_clears_value() {
assert!(root.is_null());
}

let mut output: Vec<u8> = Vec::new();
let mut output: alloc::vec::Vec<u8> = alloc::vec::Vec::new();
crate::serialize::write_message(&mut output, &message).unwrap();
assert_eq!(output.len(), 40);
for byte in &output[8..] {
Expand Down
2 changes: 1 addition & 1 deletion capnp/src/private/layout_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn test_at_alignments(words: &[crate::Word], verify: &dyn Fn(PointerReader)) {

#[cfg(all(feature = "unaligned", feature = "alloc"))]
{
let mut unaligned_data = crate::Vec::with_capacity((words.len() + 1) * 8);
let mut unaligned_data = alloc::vec::Vec::with_capacity((words.len() + 1) * 8);
for offset in 0..8 {
unaligned_data.clear();
unaligned_data.resize(offset, 0);
Expand Down

0 comments on commit d03f4e8

Please sign in to comment.