@@ -35,17 +35,14 @@ use crate::tracker::statistics_importer::StatisticsImporter;
3535
3636const NUMBER_OF_ARGUMENTS : usize = 0 ;
3737
38- #[ derive( Debug ) ]
39- pub struct Arguments { }
40-
4138#[ derive( Debug , Display , PartialEq , Error ) ]
4239#[ allow( dead_code) ]
4340pub enum ImportError {
4441 #[ display( fmt = "internal server error" ) ]
4542 WrongNumberOfArgumentsError ,
4643}
4744
48- fn parse_args ( ) -> Result < Arguments , ImportError > {
45+ fn parse_args ( ) -> Result < ( ) , ImportError > {
4946 let args: Vec < String > = env:: args ( ) . skip ( 1 ) . collect ( ) ;
5047
5148 if args. len ( ) != NUMBER_OF_ARGUMENTS {
@@ -59,7 +56,7 @@ fn parse_args() -> Result<Arguments, ImportError> {
5956 return Err ( ImportError :: WrongNumberOfArgumentsError ) ;
6057 }
6158
62- Ok ( Arguments { } )
59+ Ok ( ( ) )
6360}
6461
6562fn print_usage ( ) {
@@ -74,15 +71,16 @@ fn print_usage() {
7471}
7572
7673pub async fn run_importer ( ) {
77- import ( & parse_args ( ) . expect ( "unable to parse command arguments" ) ) . await ;
74+ parse_args ( ) . expect ( "unable to parse command arguments" ) ;
75+ import ( ) . await ;
7876}
7977
8078/// Import Command Arguments
8179///
8280/// # Panics
8381///
8482/// Panics if `Configuration::load_from_file` has any error.
85- pub async fn import ( _args : & Arguments ) {
83+ pub async fn import ( ) {
8684 println ! ( "Importing statistics from linked tracker ..." ) ;
8785
8886 let configuration = init_configuration ( ) . await ;
@@ -110,5 +108,5 @@ pub async fn import(_args: &Arguments) {
110108 tracker_statistics_importer
111109 . import_all_torrents_statistics ( )
112110 . await
113- . expect ( "variable `tracker_service` is unable to `update_torrents` " ) ;
111+ . expect ( "should import all torrents statistics " ) ;
114112}
0 commit comments