Skip to content

Commit

Permalink
remove unused imports flagged by latest nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Feb 20, 2024
1 parent 2576fbd commit fc3362b
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 44 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: 0 additions & 3 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
4 changes: 1 addition & 3 deletions capnp/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
//!
//! Roughly corresponds to capability.h in the C++ implementation.
#[cfg(feature = "alloc")]
use alloc::boxed::Box;
#[cfg(feature = "alloc")]
use core::future::Future;
#[cfg(feature = "alloc")]
use core::marker::{PhantomData, Unpin};
use core::marker::PhantomData;
#[cfg(feature = "rpc_try")]
use core::ops::Try;
#[cfg(feature = "alloc")]
Expand Down
1 change: 0 additions & 1 deletion capnp/src/capability_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
//! List of capabilities.
#![cfg(feature = "alloc")]

use alloc::boxed::Box;
use core::marker::PhantomData;

use crate::capability::FromClientHook;
Expand Down
5 changes: 0 additions & 5 deletions capnp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ pub mod text;
pub mod text_list;
pub mod traits;

#[cfg(feature = "alloc")]
use alloc::string::String;
#[cfg(feature = "alloc")]
use alloc::vec::Vec;

///
/// 8 bytes, aligned to an 8-byte boundary.
///
Expand Down
3 changes: 0 additions & 3 deletions capnp/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
//! }
//!
//! ```
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
use core::convert::From;
use crate::any_pointer;
use crate::private::arena::{BuilderArena, BuilderArenaImpl};
Expand Down
3 changes: 0 additions & 3 deletions capnp/src/private/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#[cfg(feature = "alloc")]
use alloc::vec::Vec;
use core::slice;
use core::u64;

use crate::message;
use crate::message::Allocator;
Expand Down
2 changes: 0 additions & 2 deletions capnp/src/private/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
// THE SOFTWARE.

#![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
4 changes: 0 additions & 4 deletions capnp/src/private/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#[cfg(feature = "alloc")]
use alloc::{boxed::Box, vec::Vec};
use core::cell::Cell;
use core::mem;
use core::ptr;
Expand Down Expand Up @@ -345,8 +343,6 @@ impl WirePointer {
}

mod wire_helpers {
#[cfg(feature = "alloc")]
use alloc::boxed::Box;
use core::{ptr, slice};

use crate::data;
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 = Vec::with_capacity((words.len() + 1) * 8);
for offset in 0..8 {
unaligned_data.clear();
unaligned_data.resize(offset, 0);
Expand Down
12 changes: 2 additions & 10 deletions capnp/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ pub(crate) mod no_alloc_buffer_segments;
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 +107,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 +137,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 Expand Up @@ -686,8 +680,6 @@ where
#[cfg(feature = "alloc")]
#[cfg(test)]
pub mod test {
use alloc::vec::Vec;

use crate::io::{Read, Write};

use quickcheck::{quickcheck, TestResult};
Expand Down
5 changes: 0 additions & 5 deletions capnp/src/serialize/no_alloc_buffer_segments.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use core::convert::TryInto;

use crate::message::ReaderOptions;
use crate::message::ReaderSegments;
use crate::private::units::BYTES_PER_WORD;
Expand Down Expand Up @@ -354,9 +352,6 @@ mod tests {
#[cfg(feature = "alloc")]
use super::{NoAllocBufferSegmentType, NoAllocBufferSegments, NoAllocSliceSegments};

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

#[repr(align(8))]
struct Aligned([u8; 8]);

Expand Down
2 changes: 0 additions & 2 deletions capnp/src/serialize_packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,6 @@ where
#[cfg(feature = "alloc")]
#[cfg(test)]
mod tests {
use alloc::vec::Vec;

use crate::io::{Read, Write};

use quickcheck::{quickcheck, TestResult};
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 fc3362b

Please sign in to comment.