Use Option instead of once/empty.

This commit is contained in:
Stephen Chung
2022-06-11 16:01:15 +08:00
parent 8999872d62
commit b9cbeb65d6
7 changed files with 34 additions and 30 deletions

View File

@@ -123,9 +123,7 @@ impl Engine {
let param_type_names: crate::StaticVec<_> = F::param_names()
.iter()
.map(|ty| format!("_: {}", self.format_type_name(ty)))
.chain(std::iter::once(
self.format_type_name(F::return_type_name()).into(),
))
.chain(Some(self.format_type_name(F::return_type_name()).into()))
.collect();
#[cfg(feature = "metadata")]