Add to_string to prepare for string interpolation.

This commit is contained in:
Stephen Chung
2020-03-31 10:00:17 +08:00
parent c17dc34f86
commit dcf5eaf64d
6 changed files with 64 additions and 48 deletions

View File

@@ -12,7 +12,7 @@ fn test_chars() -> Result<(), EvalAltResult> {
assert_eq!(engine.eval::<char>(r#"let x="hello"; x[2]"#)?, 'l');
assert_eq!(
engine.eval::<String>(r#"let y="hello"; y[2]='$'; y"#)?,
"he$lo".to_string()
"he$lo"
);
}