mirror of
https://gitee.com/openharmony/third_party_rust_lazy-static.rs
synced 2024-12-03 13:21:21 +00:00
Move to new slice syntax
This fixes some warnings.
This commit is contained in:
parent
95cbd48c7b
commit
cafdef58b9
@ -25,11 +25,11 @@ fn times_two(n: u32) -> u32 {
|
||||
|
||||
#[test]
|
||||
fn test_basic() {
|
||||
assert_eq!(STRING.as_slice(), "hello");
|
||||
assert_eq!(&STRING[..], "hello");
|
||||
assert_eq!(*NUMBER, 6);
|
||||
assert!(HASHMAP.get(&1).is_some());
|
||||
assert!(HASHMAP.get(&3).is_none());
|
||||
assert_eq!(ARRAY_BOXES.as_slice(), [Box::new(1), Box::new(2), Box::new(3)].as_slice());
|
||||
assert_eq!(&ARRAY_BOXES[..], &[Box::new(1), Box::new(2), Box::new(3)][..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user