@@ -61,7 +61,9 @@ pub(crate) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
6161 let home = env:: var ( "HOME" ) . unwrap ( ) ;
6262 utils:: create_json_file (
6363 utils:: Save :: Running ,
64- app. informations [ app. subsindex ] [ index] . clone ( ) . running_json ( ) ,
64+ app. informations [ app. subsindex ] [ index]
65+ . clone ( )
66+ . running_json ( ) ,
6567 )
6668 . unwrap_or_else ( |err| panic ! ( "err {}" , err) ) ;
6769 Command :: new ( "pkill" )
@@ -123,12 +125,12 @@ pub(crate) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
123125 // .collect();
124126 let get_list = spider:: get_the_key ( app. subscription . clone ( ) ) . await ;
125127 if let Ok ( list) = get_list {
126- if !list. is_empty ( ) {
128+ if !list. is_empty ( ) {
127129 let mut storge: String = "[\n \n " . to_string ( ) ;
128- let mut subs : Vec < Vec < String > > =Vec :: new ( ) ;
129- let mut information : Vec < Vec < spider:: Information > > = Vec :: new ( ) ;
130- let mut state: Vec < ListState > = Vec :: new ( ) ;
131- for lista in list {
130+ let mut subs: Vec < Vec < String > > = Vec :: new ( ) ;
131+ let mut information: Vec < Vec < spider:: Information > > = Vec :: new ( ) ;
132+ let mut state: Vec < ListState > = Vec :: new ( ) ;
133+ for lista in list {
132134 let mut ainformation: Vec < spider:: Information > = Vec :: new ( ) ;
133135 //let mut asub: Vec<String> = Vec::new();
134136 storge. push_str ( "[\n \n " ) ;
@@ -137,19 +139,19 @@ pub(crate) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
137139 let inform = spider:: Information :: new ( alist. to_string ( ) ) ;
138140 ainformation. push ( inform. clone ( ) ) ;
139141 storge. push_str ( & inform. get_the_json_node ( ) ) ;
140-
141142 }
142143 storge. pop ( ) ;
143144 storge. pop ( ) ;
144145 storge. push_str ( "\n ]," ) ;
145146 }
146147 state. push ( ListState :: default ( ) ) ;
147- subs. push ( ainformation
148- . iter ( )
149- . map ( |ainfor| spider:: remove_quotation ( ainfor. ps . clone ( ) ) )
150- . collect ( ) ) ;
148+ subs. push (
149+ ainformation
150+ . iter ( )
151+ . map ( |ainfor| spider:: remove_quotation ( ainfor. ps . clone ( ) ) )
152+ . collect ( ) ,
153+ ) ;
151154 information. push ( ainformation) ;
152-
153155 }
154156 app. state = state;
155157 app. subs = subs;
@@ -160,8 +162,7 @@ pub(crate) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
160162 . unwrap_or_else ( |err| panic ! ( "err {}" , err) ) ;
161163 app. subsindex = 0 ;
162164 app. state [ 0 ] . select ( Some ( 0 ) ) ;
163- app. stateoflist =true ;
164-
165+ app. stateoflist = true ;
165166 }
166167 }
167168 }
0 commit comments