avm1: Made AvmString debug actually show contents of the string

This commit is contained in:
Nathan Adams 2020-07-22 21:55:49 +02:00 committed by Mike Welsh
parent f3cc726a06
commit 9ae10b6387
1 changed files with 10 additions and 1 deletions

View File

@ -4,13 +4,22 @@ use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
#[derive(Debug, Clone, Copy, Collect)]
#[derive(Clone, Copy, Collect)]
#[collect(no_drop)]
enum Source<'gc> {
Owned(Gc<'gc, String>),
Static(&'static str),
}
impl fmt::Debug for Source<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Source::Owned(str) => f.debug_tuple("Owned").field(str.deref()).finish(),
Source::Static(str) => f.debug_tuple("Static").field(str).finish(),
}
}
}
#[derive(Debug, Clone, Copy, Collect)]
#[collect(no_drop)]
pub struct AvmString<'gc> {