Address review comment

This commit is contained in:
Tom Hvitved
2025-03-20 11:39:52 +01:00
parent 0bf2bfa2f1
commit d19188db8f
8 changed files with 12 additions and 25 deletions

View File

@@ -1,2 +1,2 @@
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
top.rs 3db0fd908579f949394294727474f5ba2e3d483f87d5b5737b7e81f36a457c7d 3db0fd908579f949394294727474f5ba2e3d483f87d5b5737b7e81f36a457c7d
top.rs b8d7b2a61083b08e42a2cc490ee8f2f4b931103513f4c6a9bb5ce077a6b1a854 b8d7b2a61083b08e42a2cc490ee8f2f4b931103513f4c6a9bb5ce077a6b1a854

View File

@@ -77,7 +77,7 @@ impl From<trap::Label<Locatable>> for trap::Label<Element> {
#[derive(Debug)]
pub struct NamedCrate {
pub id: trap::TrapId<NamedCrate>,
pub name: Option<String>,
pub name: String,
pub crate_: trap::Label<Crate>,
}
@@ -87,10 +87,7 @@ impl trap::TrapEntry for NamedCrate {
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("named_crates", vec![id.into(), self.crate_.into()]);
if let Some(v) = self.name {
out.add_tuple("named_crate_names", vec![id.into(), v.into()]);
}
out.add_tuple("named_crates", vec![id.into(), self.name.into(), self.crate_.into()]);
}
}