Reduce usage of Default::default()
This commit is contained in:
@@ -179,7 +179,7 @@ mod array_functions {
|
||||
if n as usize > array.len() {
|
||||
mem::take(array)
|
||||
} else {
|
||||
let mut result: Array = Default::default();
|
||||
let mut result = Array::new();
|
||||
result.extend(array.drain(array.len() - n as usize..));
|
||||
result
|
||||
}
|
||||
@@ -189,7 +189,7 @@ mod array_functions {
|
||||
} else if start as usize >= array.len() {
|
||||
Default::default()
|
||||
} else {
|
||||
let mut result: Array = Default::default();
|
||||
let mut result = Array::new();
|
||||
result.extend(array.drain(start as usize..));
|
||||
result
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ fn collect_fn_metadata(ctx: NativeCallContext) -> crate::Array {
|
||||
.map(|&s| s.into())
|
||||
.collect();
|
||||
|
||||
let mut list: Array = Default::default();
|
||||
let mut list = Array::new();
|
||||
|
||||
ctx.iter_namespaces()
|
||||
.flat_map(|m| m.iter_script_fn())
|
||||
|
||||
Reference in New Issue
Block a user