@@ -121,6 +121,7 @@ use std::{convert::Infallible, fmt, marker::PhantomData};
121
121
/// }
122
122
/// }
123
123
/// ```
124
+ #[ must_use = "`SignedCookieJar` should be returned as part of a `Response`, otherwise it does nothing." ]
124
125
pub struct SignedCookieJar < K = Key > {
125
126
jar : cookie:: CookieJar ,
126
127
key : Key ,
@@ -219,6 +220,7 @@ impl<K> SignedCookieJar<K> {
219
220
/// .map(|cookie| cookie.value().to_owned());
220
221
/// }
221
222
/// ```
223
+ #[ must_use]
222
224
pub fn get ( & self , name : & str ) -> Option < Cookie < ' static > > {
223
225
self . signed_jar ( ) . get ( name)
224
226
}
@@ -235,7 +237,6 @@ impl<K> SignedCookieJar<K> {
235
237
/// jar.remove(Cookie::from("foo"))
236
238
/// }
237
239
/// ```
238
- #[ must_use]
239
240
pub fn remove < C : Into < Cookie < ' static > > > ( mut self , cookie : C ) -> Self {
240
241
self . signed_jar_mut ( ) . remove ( cookie) ;
241
242
self
@@ -255,7 +256,6 @@ impl<K> SignedCookieJar<K> {
255
256
/// jar.add(Cookie::new("foo", "bar"))
256
257
/// }
257
258
/// ```
258
- #[ must_use]
259
259
#[ allow( clippy:: should_implement_trait) ]
260
260
pub fn add < C : Into < Cookie < ' static > > > ( mut self , cookie : C ) -> Self {
261
261
self . signed_jar_mut ( ) . add ( cookie) ;
@@ -264,6 +264,7 @@ impl<K> SignedCookieJar<K> {
264
264
265
265
/// Verifies the authenticity and integrity of `cookie`, returning the plaintext version if
266
266
/// verification succeeds or `None` otherwise.
267
+ #[ must_use]
267
268
pub fn verify ( & self , cookie : Cookie < ' static > ) -> Option < Cookie < ' static > > {
268
269
self . signed_jar ( ) . verify ( cookie)
269
270
}
@@ -302,6 +303,7 @@ impl<K> IntoResponse for SignedCookieJar<K> {
302
303
}
303
304
}
304
305
306
+ #[ must_use = "iterators are lazy and do nothing unless consumed" ]
305
307
struct SignedCookieJarIter < ' a , K > {
306
308
jar : & ' a SignedCookieJar < K > ,
307
309
iter : cookie:: Iter < ' a > ,
0 commit comments