Skip to content

Commit

Permalink
more warning avoidance
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Feb 20, 2024
1 parent e9b0863 commit 18d869e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use std::collections::binary_heap::BinaryHeap;
use std::collections::hash_map::HashMap;
use std::mem;
use std::rc::{Rc, Weak};
use std::vec::Vec;

use crate::attach::Attach;
use crate::local::ResultsDoneHook;
Expand Down
3 changes: 1 addition & 2 deletions capnp/src/private/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

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

use crate::any_pointer;
use crate::capability::{Params, Promise, RemotePromise, Request, Results};
Expand Down Expand Up @@ -137,7 +136,7 @@ pub trait PipelineHook {

/// Version of get_pipelined_cap() passing the array by move. May avoid a copy in some cases.
/// Default implementation just calls the other version.
fn get_pipelined_cap_move(&self, ops: Vec<PipelineOp>) -> Box<dyn ClientHook> {
fn get_pipelined_cap_move(&self, ops: alloc::vec::Vec<PipelineOp>) -> Box<dyn ClientHook> {
self.get_pipelined_cap(&ops)
}
}
Expand Down
8 changes: 2 additions & 6 deletions capnp/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ pub use no_alloc_buffer_segments::{NoAllocBufferSegments, NoAllocSliceSegments};
use crate::io::{Read, Write};
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
#[cfg(feature = "alloc")]
use core::convert::TryInto;
#[cfg(feature = "alloc")]
use core::ops::Deref;

use crate::message;
use crate::private::units::BYTES_PER_WORD;
Expand Down Expand Up @@ -113,7 +109,7 @@ pub struct BufferSegments<T> {
}

#[cfg(feature = "alloc")]
impl<T: Deref<Target = [u8]>> BufferSegments<T> {
impl<T: core::ops::Deref<Target = [u8]>> BufferSegments<T> {
/// Reads a serialized message (including a segment table) from a buffer and takes ownership, without copying.
/// The buffer is allowed to be longer than the message. Provide this to `Reader::new` with options that make
/// sense for your use case. Very long lived mmaps may need unlimited traversal limit.
Expand Down Expand Up @@ -143,7 +139,7 @@ impl<T: Deref<Target = [u8]>> BufferSegments<T> {
}

#[cfg(feature = "alloc")]
impl<T: Deref<Target = [u8]>> message::ReaderSegments for BufferSegments<T> {
impl<T: core::ops::Deref<Target = [u8]>> message::ReaderSegments for BufferSegments<T> {
fn get_segment(&self, id: u32) -> Option<&[u8]> {
if id < self.segment_indices.len() as u32 {
let (a, b) = self.segment_indices[id as usize];
Expand Down
1 change: 0 additions & 1 deletion capnpc/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use std::collections;
use std::collections::{HashMap, HashSet};
use std::path::{Path, PathBuf};

use capnp;
use capnp::schema_capnp;
use capnp::Error;

Expand Down

0 comments on commit 18d869e

Please sign in to comment.