Remove public Dynamic::as_str.

This commit is contained in:
Stephen Chung
2021-03-05 23:00:27 +08:00
parent ca1ce6b6b8
commit a251219730
5 changed files with 22 additions and 18 deletions

View File

@@ -190,7 +190,7 @@ impl fmt::Display for EvalAltResult {
| Self::ErrorTerminated(_, _) => f.write_str(desc)?,
Self::ErrorRuntime(d, _) if d.is::<ImmutableString>() => {
let s = d.as_str().unwrap();
let s = &*d.read_lock::<ImmutableString>().unwrap();
write!(f, "{}: {}", desc, if s.is_empty() { desc } else { s })?
}
Self::ErrorRuntime(d, _) if d.is::<()>() => f.write_str(desc)?,