@@ -24,7 +24,7 @@ use windows::Win32::{
2424pub fn create_scheduled_task ( name : & str , exe_path : & str ) -> Result < ( ) > {
2525 let task_xml_path = create_task_file ( name, exe_path)
2626 . map_err ( |err| anyhow ! ( "Failed to create scheduled task, {err}" ) ) ?;
27- debug ! ( "scheduled task file: {}" , task_xml_path ) ;
27+ debug ! ( "scheduled task file: {task_xml_path}" ) ;
2828 let output = Command :: new ( "schtasks" )
2929 . creation_flags ( CREATE_NO_WINDOW . 0 ) // CREATE_NO_WINDOW flag
3030 . args ( [ "/create" , "/tn" , name, "/xml" , & task_xml_path, "/f" ] )
@@ -69,7 +69,7 @@ fn create_task_file(name: &str, exe_path: &str) -> Result<String> {
6969 . map_err ( |err| anyhow ! ( "Failed to get author and user id, {err}" ) ) ?;
7070 let current_time = get_current_time ( ) ;
7171 let command_path = if exe_path. contains ( |c : char | c. is_whitespace ( ) ) {
72- format ! ( "\" {}\" " , exe_path )
72+ format ! ( "\" {exe_path }\" " )
7373 } else {
7474 exe_path. to_string ( )
7575 } ;
@@ -200,7 +200,7 @@ fn get_author_and_userid() -> WindowsResult<(String, String)> {
200200 . to_string_lossy ( )
201201 . into_owned ( ) ;
202202
203- Ok ( ( format ! ( "{}\\ {}" , domainname , username ) , sid_str) )
203+ Ok ( ( format ! ( "{domainname }\\ {username}" ) , sid_str) )
204204}
205205
206206fn get_current_time ( ) -> String {
0 commit comments