@@ -3,11 +3,13 @@ use crate::builtins::{PyStr, PyStrRef};
33/// Inspired by: https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
44/// And: https://www.youtube.com/watch?v=p33CVV29OG8
55/// 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+ } ;
710use crate :: vm:: VirtualMachine ;
811use crate :: { IdProtocol , IntoPyObject , PyObjectRef , PyRefExact , PyResult , TypeProtocol } ;
912use crossbeam_utils:: atomic:: AtomicCell ;
10- use rustpython_common:: hash;
1113use std:: fmt;
1214use std:: mem:: size_of;
1315
@@ -766,6 +768,7 @@ fn extract_dict_entry<T>(option_entry: &Option<DictEntry<T>>) -> &DictEntry<T> {
766768#[ cfg( test) ]
767769mod tests {
768770 use super :: { Dict , DictKey } ;
771+ use crate :: common:: ascii;
769772 use crate :: Interpreter ;
770773
771774 #[ test]
@@ -775,12 +778,12 @@ mod tests {
775778 assert_eq ! ( 0 , dict. len( ) ) ;
776779
777780 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" ) ) ;
779782 dict. insert ( & vm, key1. clone ( ) , value1. clone ( ) ) . unwrap ( ) ;
780783 assert_eq ! ( 1 , dict. len( ) ) ;
781784
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" ) ) ;
784787 dict. insert ( & vm, key2. clone ( ) , value2. clone ( ) ) . unwrap ( ) ;
785788 assert_eq ! ( 2 , dict. len( ) ) ;
786789
0 commit comments