Skip to content

Commit

Permalink
fix warnings and machette
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrrnn committed Aug 2, 2024
1 parent 656c681 commit 87851d8
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 20 deletions.
1 change: 0 additions & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ sysinfo = "0.31.2"
log4rs = "1.3.0"


# static bind lzma
lzma-sys = { version = "0.1.0", features = ["static"] }
log = "0.4.22"


Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/binary_resolver.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::download_utils::{download_file, extract};
use crate::github;
use crate::xmrig::latest_release::fetch_latest_release;
use anyhow::{anyhow, Error};
use async_trait::async_trait;
use semver::Version;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/cpu_miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl CpuMiner {
}
};
let xmrig = XmrigAdapter::new(xmrig_node_connection, "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A".to_string() );
let (mut rx, mut xmrig_child, client) = xmrig.spawn()?;
let (mut _rx, mut xmrig_child, client) = xmrig.spawn()?;
self.api_client = Some(client);

self.watcher_task = Some(tauri::async_runtime::spawn(async move {
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/download_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ pub async fn extract_gz(gz_path: &Path, dest_dir: &Path) -> std::io::Result<()>
Ok(())
}

use crate::xmrig::http_api::XmrigHttpApiClient;
use anyhow::anyhow;
use async_zip::base::read::seek::ZipFileReader;
use flate2::read::GzDecoder;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use tokio::sync::RwLock;

#[tauri::command]
async fn start_mining<'r>(
window: tauri::Window,
_window: tauri::Window,
state: tauri::State<'r, UniverseAppState>,
app: tauri::AppHandle,
) -> Result<(), String> {
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/process_watcher.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::process_adapter::{ProcessAdapter, ProcessInstance};
use std::marker::PhantomData;
use std::path::PathBuf;
use tari_shutdown::{Shutdown, ShutdownSignal};
use tauri::async_runtime::JoinHandle;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/xmrig/http_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl XmrigHttpApiClient {
}

pub async fn summary(&self) -> Result<models::Summary, anyhow::Error> {
for i in 0..3 {
for _i in 0..3 {
let response = self.get("2/summary").await?;

let summary = response.text().await?;
Expand Down
14 changes: 3 additions & 11 deletions src-tauri/src/xmrig_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@ use crate::cpu_miner::CpuMinerEvent;
use crate::download_utils::{download_file, extract};
use crate::xmrig::http_api::XmrigHttpApiClient;
use crate::xmrig::latest_release::fetch_latest_release;
use anyhow::{anyhow, Error};
use async_zip::base::read::seek::ZipFileReader;
use flate2::read::GzDecoder;
use futures_util::{FutureExt, StreamExt};
use std::path::{Path, PathBuf};
use tar::Archive;
use anyhow::Error;
use std::path::PathBuf;
use tari_shutdown::Shutdown;
use tokio::fs;
use tokio::fs::File;
use tokio::fs::OpenOptions;
use tokio::io::AsyncWriteExt;
use tokio::io::BufReader;
use tokio::runtime::Handle;
use tokio::sync::mpsc::Receiver;
use tokio::task::JoinHandle;
Expand Down Expand Up @@ -67,7 +59,7 @@ impl XmrigAdapter {
pub fn spawn(
&self,
) -> Result<(Receiver<CpuMinerEvent>, XmrigInstance, XmrigHttpApiClient), anyhow::Error> {
let (tx, rx) = tokio::sync::mpsc::channel(100);
let (_tx, rx) = tokio::sync::mpsc::channel(100);
let cache_dir = tauri::api::path::cache_dir()
.ok_or(anyhow::anyhow!("Failed to get cache dir"))?
.join("tari-universe");
Expand Down

0 comments on commit 87851d8

Please sign in to comment.