Skip to content

Commit

Permalink
refactor: remove unused vars and compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Jul 29, 2024
1 parent 3da6b2e commit f21d587
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
20 changes: 1 addition & 19 deletions src-tauri/src/bugsnag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ use reqwest::header::{HeaderMap, CONTENT_TYPE};
use tokio::runtime::Runtime;
extern crate chrono;
use chrono::prelude::*;
use std::fs::File;
use std::io::{self, BufRead, BufReader};
use std::env;

#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct JsonFrame {
pub struct JsonFrame {
file: String,
line_number: u32,
column_number: u32,
Expand Down Expand Up @@ -200,22 +198,6 @@ fn get_current_time() -> String {
now.to_rfc3339_opts(SecondsFormat::Millis, true)
}

fn get_linux_flavor() -> io::Result<String> {
let os_release_file = File::open("/etc/os-release")?;
let reader = BufReader::new(os_release_file);

// Parse the os-release file to find the PRETTY_NAME
for line in reader.lines() {
let line = line?;
if line.starts_with("PRETTY_NAME") {
// Typically the line looks like `PRETTY_NAME="Ubuntu 20.04 LTS"`
return Ok(line.split('=').nth(1).unwrap_or("\"Unknown\"").trim_matches('"').to_string());
}
}

Ok("Unknown Linux Flavor".to_string())
}

fn get_sysinfo() -> (String, String, String, String) {
let info = os_info::get();
let os_type = info.os_type().to_string();
Expand Down
4 changes: 3 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn main() {
panic_message
);

let mut should_log_to_bugsnag = false;
let should_log_to_bugsnag;
#[cfg(target_os = "linux")]
{
let choice = dialog::Question::new(&error_message)
Expand All @@ -294,6 +294,8 @@ fn main() {
.expect("Could not display dialog box");
if choice == dialog::Choice::Yes {
should_log_to_bugsnag = true;
} else {
should_log_to_bugsnag = false;
}
}

Expand Down

0 comments on commit f21d587

Please sign in to comment.