Refactored code, no need for recompile

This commit is contained in:
brotoskyj
2025-01-20 17:56:02 -05:00
parent 6a30f76c17
commit 069356a8f8
+5 -5
View File
@@ -1,8 +1,6 @@
#![windows_subsystem = "windows"] #![windows_subsystem = "windows"]
use std::fs::File;
use image::Luma; use image::Luma;
use native_dialog::{FileDialog, MessageDialog, MessageType}; use native_dialog::FileDialog;
use qrcode::QrCode; use qrcode::QrCode;
slint::slint!(); slint::slint!();
slint::include_modules!(); slint::include_modules!();
@@ -22,10 +20,12 @@ fn main() {
.show_save_single_file() .show_save_single_file()
.expect("Unknown File Path") .expect("Unknown File Path")
.unwrap(); .unwrap();
let mut savelocation = result.into_os_string().into_string().unwrap(); let savelocation = result.into_os_string().into_string().unwrap();
let qrcode = QrCode::new(websitetext.as_bytes()).unwrap(); let qrcode = QrCode::new(websitetext.as_bytes()).unwrap();
let image = qrcode.render::<Luma<u8>>().build(); let image = qrcode.render::<Luma<u8>>().build();
image.save(savelocation); image
.save(savelocation)
.expect("Couldn't save file");
} }
}); });
app.run().unwrap(); app.run().unwrap();