@@ -3,11 +3,13 @@ use crate::builtins::{PyStr, PyStrRef};
3
3
/// Inspired by: https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
4
4
/// And: https://www.youtube.com/watch?v=p33CVV29OG8
5
5
/// And: http://code.activestate.com/recipes/578375/
6
- use crate :: common:: lock:: { PyRwLock , PyRwLockReadGuard , PyRwLockWriteGuard } ;
6
+ use crate :: common:: {
7
+ hash,
8
+ lock:: { PyRwLock , PyRwLockReadGuard , PyRwLockWriteGuard } ,
9
+ } ;
7
10
use crate :: vm:: VirtualMachine ;
8
11
use crate :: { IdProtocol , IntoPyObject , PyObjectRef , PyRefExact , PyResult , TypeProtocol } ;
9
12
use crossbeam_utils:: atomic:: AtomicCell ;
10
- use rustpython_common:: hash;
11
13
use std:: fmt;
12
14
use std:: mem:: size_of;
13
15
@@ -766,6 +768,7 @@ fn extract_dict_entry<T>(option_entry: &Option<DictEntry<T>>) -> &DictEntry<T> {
766
768
#[ cfg( test) ]
767
769
mod tests {
768
770
use super :: { Dict , DictKey } ;
771
+ use crate :: common:: ascii;
769
772
use crate :: Interpreter ;
770
773
771
774
#[ test]
@@ -775,12 +778,12 @@ mod tests {
775
778
assert_eq ! ( 0 , dict. len( ) ) ;
776
779
777
780
let key1 = vm. ctx . new_bool ( true ) ;
778
- let value1 = vm. ctx . new_ascii_literal ( crate :: utils :: ascii!( "abc" ) ) ;
781
+ let value1 = vm. ctx . new_ascii_literal ( ascii ! ( "abc" ) ) ;
779
782
dict. insert ( & vm, key1. clone ( ) , value1. clone ( ) ) . unwrap ( ) ;
780
783
assert_eq ! ( 1 , dict. len( ) ) ;
781
784
782
- let key2 = vm. ctx . new_ascii_literal ( crate :: utils :: ascii!( "x" ) ) ;
783
- let value2 = vm. ctx . new_ascii_literal ( crate :: utils :: ascii!( "def" ) ) ;
785
+ let key2 = vm. ctx . new_ascii_literal ( ascii ! ( "x" ) ) ;
786
+ let value2 = vm. ctx . new_ascii_literal ( ascii ! ( "def" ) ) ;
784
787
dict. insert ( & vm, key2. clone ( ) , value2. clone ( ) ) . unwrap ( ) ;
785
788
assert_eq ! ( 2 , dict. len( ) ) ;
786
789
0 commit comments