1 parent c86795c commit 2936eb7Copy full SHA for 2936eb7
1 file changed
s3/src/command.rs
@@ -233,6 +233,22 @@ impl<'a> Command<'a> {
233
/// stray `Content-Length: 0` / `Content-Type: text/plain` headers do
234
/// not enter the AWS4-HMAC-SHA256 canonical request, which Cloudflare
235
/// R2 rejects as a signature mismatch (notably for ranged `GET`s).
236
+ ///
237
+ /// # Examples
238
239
+ /// ```
240
+ /// use s3::command::Command;
241
242
+ /// assert!(Command::PutObject {
243
+ /// content: b"hi",
244
+ /// content_type: "text/plain",
245
+ /// custom_headers: None,
246
+ /// multipart: None,
247
+ /// }
248
+ /// .has_body());
249
+ /// assert!(!Command::GetObject.has_body());
250
+ /// assert!(!Command::GetObjectRange { start: 0, end: Some(1023) }.has_body());
251
252
pub fn has_body(&self) -> bool {
253
matches!(
254
self,
0 commit comments