Change interface SDL to adhere to spec

When only one interface is implemented, there is no &. The & is only to combine more than one interface.
This commit is contained in:
Daniel Wiesenberg 2020-10-26 12:40:05 +01:00
parent e3990d0a56
commit efd4ee61cb
No known key found for this signature in database
GPG Key ID: A3BC00FBB8EDFCBF

View File

@ -131,10 +131,7 @@ impl Registry {
write!(sdl, "type {} ", name).ok();
if let Some(implements) = self.implements.get(name) {
if !implements.is_empty() {
write!(sdl, "implements ").ok();
for interface in implements {
write!(sdl, "& {} ", interface).ok();
}
write!(sdl, "implements {} ", implements.iter().map(AsRef::as_ref).collect::<Vec<&str>>().join(" & ")).ok();
}
}