We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2229a1c + 6765e2f commit e7b62c4Copy full SHA for e7b62c4
1 file changed
any/any.md
@@ -11,10 +11,8 @@
11
这下可坏了……Rust不支持重载啊!于是有人就很单纯的写了两个函数~~!
12
13
其实不用……我们只需要这么写……
14
-* 只能在nightly下编译通过
15
16
```rust
17
-#![feature(vec_push_all)]
18
use std::any::Any;
19
use std::fmt::Debug ;
20
@@ -27,7 +25,7 @@ fn load_config<T:Any+Debug>(value: &T) -> Vec<String>{
27
25
};
28
26
29
match value.downcast_ref::<Vec<String>>() {
30
- Some(v) => cfgs.push_all(&v),
+ Some(v) => cfgs.extend_from_slice(&v),
31
None =>(),
32
}
33
0 commit comments