1- use core:: fmt:: Display ;
21use crate :: environment:: Environment ;
32use crate :: ifn:: IFn ;
43use crate :: keyword:: Keyword ;
@@ -10,6 +9,7 @@ use crate::persistent_list_map::{PersistentListMap, ToPersistentListMapIter};
109use crate :: persistent_vector:: PersistentVector ;
1110use crate :: symbol:: Symbol ;
1211use crate :: type_tag:: TypeTag ;
12+ use core:: fmt:: Display ;
1313
1414extern crate rand;
1515use rand:: Rng ;
@@ -173,9 +173,9 @@ impl fmt::Display for Value {
173173 IfMacro => std:: string:: String :: from ( "#macro[if*]" ) ,
174174 LetMacro => std:: string:: String :: from ( "#macro[let*]" ) ,
175175 Value :: String ( string) => string. clone ( ) ,
176- Pattern ( pattern) => {
177- std :: string :: String :: from ( "#\" " . to_owned ( ) + pattern. as_str ( ) . clone ( ) + "\" " )
178- }
176+ Pattern ( pattern) => std :: string :: String :: from (
177+ "#\" " . to_owned ( ) + & pattern. as_str ( ) . escape_default ( ) . to_string ( ) . clone ( ) + "\" " ,
178+ ) ,
179179 Nil => std:: string:: String :: from ( "nil" ) ,
180180 } ;
181181 write ! ( f, "{}" , str )
@@ -624,11 +624,11 @@ impl ToValue for PersistentListMap {
624624 Value :: PersistentListMap ( self . clone ( ) )
625625 }
626626}
627- impl < T : Display > ToValue for Result < Value , T > {
627+ impl < T : Display > ToValue for Result < Value , T > {
628628 fn to_value ( & self ) -> Value {
629629 match self {
630630 Ok ( val) => val. clone ( ) ,
631- Err ( err) => Value :: Condition ( err. to_string ( ) )
631+ Err ( err) => Value :: Condition ( err. to_string ( ) ) ,
632632 }
633633 }
634634}
0 commit comments