@@ -5,8 +5,8 @@ pub(crate) mod sqlite;
55use crate :: protos:: Item ;
66use core:: str:: FromStr ;
77use std:: { fmt:: Display , io:: { Read , Seek , SeekFrom } , marker:: PhantomData } ;
8- use actix_web:: { web:: Bytes } ;
9- use anyhow:: { Error , Context , bail, format_err} ;
8+ use actix_web:: web:: Bytes ;
9+ use anyhow:: { Error , bail, format_err} ;
1010use bs58;
1111use futures:: Stream ;
1212use serde:: { Deserialize , de:: { self , Visitor } } ;
@@ -349,6 +349,7 @@ pub struct ItemDisplayRow {
349349 // TODO: Make an Arc<String> to avoid heap allocs?
350350 // Or just make filling this in optional, since that's only used by the old HTML UI.
351351 /// The display name for the author of the item, if available.
352+ #[ allow( dead_code) ]
352353 pub display_name : Option < String >
353354}
354355
@@ -375,18 +376,6 @@ impl Timestamp {
375376 unix_utc_ms : delta. whole_milliseconds ( ) as i64 ,
376377 }
377378 }
378-
379- pub fn format_with_offset ( self , minutes : i16 ) -> String {
380- use time:: { Duration , UtcOffset , OffsetDateTime } ;
381- use std:: ops:: Add ;
382-
383- let ms = Duration :: milliseconds ( self . unix_utc_ms ) ;
384- let datetime = OffsetDateTime :: unix_epoch ( ) . add ( ms) ;
385- let offset = UtcOffset :: minutes ( minutes) ;
386- let datetime = datetime. to_offset ( offset) ;
387-
388- datetime. format ( "%Y-%m-%d %H:%M:%S %z" )
389- }
390379}
391380/// A reason why a user can't post an Item or file attachment.
392381pub enum QuotaDenyReason {
@@ -403,6 +392,7 @@ pub enum QuotaDenyReason {
403392 UnknownUser ,
404393
405394 /// We already have a profile that proves that this userID has been revoked.
395+ #[ allow( dead_code) ]
406396 ProfileRevoked ,
407397}
408398
@@ -451,11 +441,9 @@ impl SHA512 {
451441 file. seek ( SeekFrom :: Start ( 0 ) ) ?;
452442 let mut buf = [ 0u8 ; 8 * 1024 ] ;
453443 let mut hasher = sha512:: State :: new ( ) ;
454- let mut bytes = 0 ;
455444 loop {
456445 let count = file. read ( & mut buf) ?;
457446 if count == 0 { break ; }
458- bytes += count;
459447 hasher. update ( & buf[ ..count] ) ;
460448 }
461449
@@ -494,10 +482,6 @@ impl TimeSpan {
494482 }
495483}
496484
497- pub struct UsageByUserOpts {
498-
499- }
500-
501485pub struct PruneOpts {
502486 /// If set, then we don't actually do the delete and just report on what *would* be deleted.
503487 pub dry_run : bool ,
@@ -528,7 +512,7 @@ pub struct PruneResult {
528512
529513impl Display for PruneResult {
530514 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
531- use tablestream:: { Stream , col, Column } ;
515+ use tablestream:: { Stream , col} ;
532516
533517 let title = if self . dry_run { "Dry run:" } else { "Pruned:" } ;
534518
@@ -549,22 +533,23 @@ impl Display for PruneResult {
549533 name : "Attachments" ,
550534 count : self . attachments_count ,
551535 size : SizeDisplay :: bytes ( self . attachments_bytes ) ,
552- } ) . map_err ( |e | std:: fmt:: Error ) ?;
536+ } ) . map_err ( |_ | std:: fmt:: Error ) ?;
553537
554538 stream. row ( Row {
555539 name : "Items" ,
556540 count : self . items_count ,
557541 size : SizeDisplay :: bytes ( self . items_count )
558- } ) . map_err ( |e | std:: fmt:: Error ) ?;
542+ } ) . map_err ( |_ | std:: fmt:: Error ) ?;
559543
560544 let footer = format ! ( "Total size: {}" , SizeDisplay :: bytes( self . items_bytes + self . attachments_bytes) ) ;
561- stream. footer ( & footer) . map_err ( |e | std:: fmt:: Error ) ?;
545+ stream. footer ( & footer) . map_err ( |_ | std:: fmt:: Error ) ?;
562546
563547 write ! ( f, "{}" , String :: from_utf8_lossy( & out) )
564548 }
565549}
566550
567551/// Information about a single user's database usage.
552+ #[ allow( dead_code) ]
568553pub struct UsageByUserRow {
569554 pub user_id : UserID ,
570555 pub display_name : Option < String > ,
0 commit comments