From 58fec056ba3fc0593ffdfd383e2ad8deaa2d7b8f Mon Sep 17 00:00:00 2001 From: Sakapoi <97370653+Sakapoi@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:36:23 +0300 Subject: [PATCH] fixed tests (#1444) --- module/core/collection_tools/src/lib.rs | 4 ++-- module/core/collection_tools/tests/inc/deque.rs | 4 ++-- module/core/collection_tools/tests/inc/vec.rs | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/core/collection_tools/src/lib.rs b/module/core/collection_tools/src/lib.rs index 5d0c5976a4..e447f16f85 100644 --- a/module/core/collection_tools/src/lib.rs +++ b/module/core/collection_tools/src/lib.rs @@ -64,7 +64,7 @@ pub mod exposed pub use prelude::*; #[ doc( inline ) ] - #[ cfg( feature = "collection_constructors" ) ] + #[ cfg( any( feature = "use_alloc", all( feature = "collection_constructors", not( feature = "no_std" ) ) ) ) ] pub use crate:: { vec as dlist, @@ -77,7 +77,7 @@ pub mod exposed }; #[ doc( inline ) ] - #[ cfg( feature = "collection_into_constructors" ) ] + #[ cfg( any( feature = "use_alloc", all( feature = "collection_into_constructors", not( feature = "no_std" ) ) ) ) ] pub use crate:: { into_vec, diff --git a/module/core/collection_tools/tests/inc/deque.rs b/module/core/collection_tools/tests/inc/deque.rs index 41c3d323b1..98ab6498bd 100644 --- a/module/core/collection_tools/tests/inc/deque.rs +++ b/module/core/collection_tools/tests/inc/deque.rs @@ -50,8 +50,8 @@ fn into_constructor() exp.push_front( 3 ); assert_eq!( got, exp ); - let _got : DequeList< &str > = the_module::deque!( "b" ); - let _got : DequeList< &str > = the_module::exposed::deque!( "b" ); + let _got = the_module::deque!( "b" ); + let _got = the_module::exposed::deque!( "b" ); } diff --git a/module/core/collection_tools/tests/inc/vec.rs b/module/core/collection_tools/tests/inc/vec.rs index ff9480659f..c1a5f66804 100644 --- a/module/core/collection_tools/tests/inc/vec.rs +++ b/module/core/collection_tools/tests/inc/vec.rs @@ -1,6 +1,7 @@ use super::*; #[ test ] +#[ cfg( any( not( feature = "no_std" ), feature = "use_alloc" ) ) ] fn reexport() { @@ -12,7 +13,8 @@ fn reexport() let got = vec1.last().unwrap().clone(); assert_eq!( got, 2 ); - let mut vec2 : the_module::DynList< i32 > = the_module::DynList::new(); + use std::vec::Vec as DynList; + let mut vec2 : DynList< i32 > = DynList::new(); vec2.push( 1 ); vec2.push( 2 ); let got = vec2.first().unwrap().clone();