Remove the special case for empty records.
* Remove the special case for empty records.
WebAssembly/component-model#104 is closed, so remove the corresponding
special case from wit-bindgen too.
* Update unit tests.
@@ -81,9 +81,6 @@ impl Interface {
}
fn mangle_recordtype(&self, fields: &[Field]) -> String {
- if fields.is_empty() {
- "record {}".to_owned()
- } else {
format!(
"record {{ {} }}",
fields
@@ -93,7 +90,6 @@ impl Interface {
.join(", ")
)
}
- }
fn mangle_tupletype(&self, ts: &[Type]) -> String {
format!(
@@ -106,9 +102,6 @@ impl Interface {
}
fn mangle_flags(&self, labels: &[Flag]) -> String {
- if labels.is_empty() {
- "flags {}".to_owned()
- } else {
format!(
"flags {{ {} }}",
labels
@@ -118,12 +111,8 @@ impl Interface {
.join(", ")
)
}
- }
fn mangle_varianttype(&self, cases: &[Case]) -> String {
- if cases.is_empty() {
- "variant {}".to_owned()
- } else {
format!(
"variant {{ {} }}",
cases
@@ -133,12 +122,8 @@ impl Interface {
.join(", ")
)
}
- }
fn mangle_enumtype(&self, labels: &[EnumCase]) -> String {
- if labels.is_empty() {
- "enum {}".to_owned()
- } else {
format!(
"enum {{ {} }}",
labels
@@ -148,12 +133,8 @@ impl Interface {
.join(", ")
)
}
- }
fn mangle_uniontype(&self, cases: &[UnionCase]) -> String {
- if cases.is_empty() {
- "union {}".to_owned()
- } else {
format!(
"union {{ {} }}",
cases
@@ -163,7 +144,6 @@ impl Interface {
.join(", ")
)
}
- }
fn mangle_optiontype(&self, t: Type) -> String {
format!("option<{}>", self.mangle_valtype(t))
