A few minor lints and docs (#1436)

* A few minor lints and docs

* Added required packages to compile on Debian-style linux
* Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline)
* a few spelling mistakes

* fix fmt
This commit is contained in:
Yuri Astrakhan 2023-10-19 02:33:10 -04:00 committed by GitHub
parent 67edac4aca
commit 3d4e3a74e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 140 additions and 158 deletions

View file

@ -85,7 +85,7 @@ fn set_random_seed(seed: f64) {
#[tauri::command]
fn handle_message(message: String) -> String {
let Ok(message) = ron::from_str::<graphite_editor::messages::message::Message>(&message) else {
panic!("Error parsing message: {}", message)
panic!("Error parsing message: {message}")
};
let responses = EDITOR.with(|editor| {
let mut editor = editor.borrow_mut();
@ -103,7 +103,7 @@ fn handle_message(message: String) -> String {
let path = image.path.clone();
let mime = image.mime.clone();
let transform = image.transform;
images.insert(format!("{:?}_{}", &image.path, document_id), image);
images.insert(format!("{:?}_{}", image.path, document_id), image);
stub_data.push(FrontendImageData {
path,
node_id: None,
@ -121,7 +121,7 @@ fn handle_message(message: String) -> String {
for response in &responses {
let serialized = ron::to_string(&send_frontend_message_to_js(response.clone())).unwrap();
if let Err(error) = ron::from_str::<FrontendMessage>(&serialized) {
log::error!("Error deserializing message: {}", error);
log::error!("Error deserializing message: {error}");
}
}