@@ -435,24 +435,22 @@ impl Client {
435435 /// # let client = Client::new(homeserver).await?;
436436 /// # let room = client.get_room(&room_id!("!test:example.com")).unwrap();
437437 /// let mut reader = std::io::Cursor::new(b"Hello, world!");
438- /// let encrypted_file = client.upload_encrypted_file(&mime::TEXT_PLAIN, & mut reader).await?;
438+ /// let encrypted_file = client.upload_encrypted_file(&mut reader).await?;
439439 ///
440440 /// room.send(CustomEventContent { encrypted_file }).await?;
441441 /// # anyhow::Ok(()) };
442442 /// ```
443443 pub fn upload_encrypted_file < ' a , R : Read + ?Sized + ' a > (
444444 & ' a self ,
445- content_type : & ' a mime:: Mime ,
446445 reader : & ' a mut R ,
447446 ) -> UploadEncryptedFile < ' a , R > {
448- UploadEncryptedFile :: new ( self , content_type , reader)
447+ UploadEncryptedFile :: new ( self , reader)
449448 }
450449
451450 /// Encrypt and upload the file and thumbnails, and return the source
452451 /// information.
453452 pub ( crate ) async fn upload_encrypted_media_and_thumbnail (
454453 & self ,
455- content_type : & mime:: Mime ,
456454 data : & [ u8 ] ,
457455 thumbnail : Option < Thumbnail > ,
458456 send_progress : SharedObservable < TransmissionProgress > ,
@@ -461,7 +459,7 @@ impl Client {
461459
462460 let upload_attachment = async {
463461 let mut cursor = Cursor :: new ( data) ;
464- self . upload_encrypted_file ( content_type , & mut cursor)
462+ self . upload_encrypted_file ( & mut cursor)
465463 . with_send_progress_observable ( send_progress)
466464 . await
467465 } ;
@@ -482,11 +480,11 @@ impl Client {
482480 return Ok ( None ) ;
483481 } ;
484482
485- let ( data, content_type , thumbnail_info) = thumbnail. into_parts ( ) ;
483+ let ( data, _ , thumbnail_info) = thumbnail. into_parts ( ) ;
486484 let mut cursor = Cursor :: new ( data) ;
487485
488486 let file = self
489- . upload_encrypted_file ( & content_type , & mut cursor)
487+ . upload_encrypted_file ( & mut cursor)
490488 . with_send_progress_observable ( send_progress)
491489 . await ?;
492490
0 commit comments