Use Box<[]>.

This commit is contained in:
Stephen Chung
2021-11-12 13:25:57 +08:00
parent bffc73435c
commit a9aa8e84fd
4 changed files with 16 additions and 8 deletions

View File

@@ -165,7 +165,8 @@ impl From<&crate::module::FuncInfo> for FnMetadata {
.get_script_fn_def()
.expect("scripted function")
.comments
.to_vec()
.as_ref()
.map_or_else(|| Vec::new(), |v| v.to_vec())
}
} else {
Vec::new()