Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/smol_str/tests/test.rs')
-rw-r--r--lib/smol_str/tests/test.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/smol_str/tests/test.rs b/lib/smol_str/tests/test.rs
index 2e2914d797..631f7d78bf 100644
--- a/lib/smol_str/tests/test.rs
+++ b/lib/smol_str/tests/test.rs
@@ -44,20 +44,6 @@ fn const_fn_ctor() {
assert_eq!(LONG, SmolStr::from("ABCDEFGHIZKLMNOPQRSTUVW"));
}
-#[allow(deprecated)]
-#[test]
-fn old_const_fn_ctor() {
- const EMPTY: SmolStr = SmolStr::new_inline_from_ascii(0, b"");
- const A: SmolStr = SmolStr::new_inline_from_ascii(1, b"A");
- const HELLO: SmolStr = SmolStr::new_inline_from_ascii(5, b"HELLO");
- const LONG: SmolStr = SmolStr::new_inline_from_ascii(23, b"ABCDEFGHIZKLMNOPQRSTUVW");
-
- assert_eq!(EMPTY, SmolStr::from(""));
- assert_eq!(A, SmolStr::from("A"));
- assert_eq!(HELLO, SmolStr::from("HELLO"));
- assert_eq!(LONG, SmolStr::from("ABCDEFGHIZKLMNOPQRSTUVW"));
-}
-
#[cfg(not(miri))]
fn check_props(std_str: &str, smol: SmolStr) -> Result<(), proptest::test_runner::TestCaseError> {
prop_assert_eq!(smol.as_str(), std_str);
@@ -253,11 +239,7 @@ fn test_bad_size_hint_char_iter() {
let collected: SmolStr = BadSizeHint(data.chars()).collect();
let new = SmolStr::new(data);
- // Because of the bad size hint, `collected` will be heap allocated, but `new` will be inline
-
- // If we try to use the type of the string (inline/heap) to quickly test for equality, we need to ensure
- // `collected` is inline allocated instead
- assert!(collected.is_heap_allocated());
+ assert!(!collected.is_heap_allocated());
assert!(!new.is_heap_allocated());
assert_eq!(new, collected);
}