about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-31 12:28:45 +0000
committerbors <bors@rust-lang.org>2021-10-31 12:28:45 +0000
commit68b554e6af18726fe6fa8de2134c59c441e0b019 (patch)
tree8361dcb08d27436f72fff5f61b8bd54c975e7ac7 /library/alloc/src/string.rs
parent58899c4d9c63a6d27ac395ee9597ae797df7f026 (diff)
parent455a79acab1b2fe1263100a7889a1f2a52256c8d (diff)
downloadrust-68b554e6af18726fe6fa8de2134c59c441e0b019.tar.gz
rust-68b554e6af18726fe6fa8de2134c59c441e0b019.zip
Auto merge of #90437 - matthiaskrgr:rollup-vd8uqm6, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #89068 (Restructure std::rt (part 2))
 - #89786 (Add #[must_use] to len and is_empty)
 - #90430 (Add #[must_use] to remaining std functions (A-N))
 - #90431 (Add #[must_use] to remaining std functions (O-Z))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 677942a1820..906b0187f7b 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -1547,6 +1547,7 @@ impl String {
     /// assert_eq!(fancy_f.chars().count(), 3);
     /// ```
     #[inline]
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn len(&self) -> usize {
         self.vec.len()
@@ -1566,6 +1567,7 @@ impl String {
     /// assert!(!v.is_empty());
     /// ```
     #[inline]
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_empty(&self) -> bool {
         self.len() == 0