Skip to content

Commit

Permalink
fix lint (remove unused imports and stuff like that)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed Jan 9, 2025
1 parent 96ea475 commit c28ce66
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/target-tauri/src-tauri/src/app_path.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::{bail, Context};
use anyhow::Context;
use serde::Deserialize;
use tauri::{AppHandle, Manager};

Expand All @@ -21,7 +21,7 @@ impl AppPathName {
AppPathName::Desktop => {
#[cfg(target_os = "android")]
{
bail!("desktop dir not available on android")
anyhow::bail!("desktop dir not available on android")
}
#[cfg(not(target_os = "android"))]
{
Expand Down
5 changes: 2 additions & 3 deletions packages/target-tauri/src-tauri/src/blobs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Context;
use log::{error, info, trace};
use log::error;
use percent_encoding::percent_decode_str;
use tauri::{Manager, UriSchemeContext, UriSchemeResponder};
use tokio::fs;
Expand All @@ -11,8 +11,7 @@ pub(crate) fn delta_blobs_protocol<R: tauri::Runtime>(
request: http::Request<Vec<u8>>,
responder: UriSchemeResponder,
) {
let path = request.uri();
// info!("dcblob {path}");
// info!("dcblob {}", request.uri());

// URI format is dcblob://<account folder name>/<blob filename>

Expand Down
2 changes: 1 addition & 1 deletion packages/target-tauri/src-tauri/src/file_dialogs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fs;

use anyhow::{bail, Context};
use anyhow::Context;

use serde::Deserialize;
use tauri::AppHandle;
Expand Down
2 changes: 1 addition & 1 deletion packages/target-tauri/src-tauri/src/help_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use tauri::{Manager, WebviewWindow};
#[tauri::command]
pub(crate) fn open_help_window(
app: tauri::AppHandle,
locale: &str,
#[allow(unused_variables)] locale: &str,
anchor: Option<&str>,
) -> Result<(), String> {
// TODO: support for languages (if help file/directory for language code exists open it, otherwise open english version)
Expand Down
1 change: 0 additions & 1 deletion packages/target-tauri/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ pub fn run() {
))?);
app.manage(tauri::async_runtime::block_on(DeltaChatAppState::try_new(
app,
startup_timestamp,
))?);
app.state::<AppState>()
.log_duration_since_startup("setup done");
Expand Down
17 changes: 4 additions & 13 deletions packages/target-tauri/src-tauri/src/state/deltachat.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
use std::{
path::PathBuf,
sync::{Arc, Mutex},
time::SystemTime,
};
use std::sync::Arc;

use anyhow::{bail, Context};
use deltachat_jsonrpc::{
api::{Accounts, CommandApi},
yerpc::{RpcClient, RpcSession},
};
use futures_lite::stream::StreamExt;

use tauri::{async_runtime::JoinHandle, AppHandle, Emitter, EventTarget, Manager};
use tauri_plugin_store::StoreExt;
use tauri::{async_runtime::JoinHandle, Emitter, EventTarget, Manager};
use tokio::sync::RwLock;

use log::info;

pub(crate) struct DeltaChatAppState {
pub(crate) deltachat: Arc<RwLock<Accounts>>,
pub(crate) deltachat_rpc_session: RpcSession<CommandApi>,
#[allow(dead_code)]
pub(crate) deltachat_rpc_send_task: JoinHandle<anyhow::Result<()>>,
}

impl DeltaChatAppState {
pub(crate) async fn try_new(
app: &tauri::App,
startup_timestamp: SystemTime,
) -> anyhow::Result<Self> {
let handle = app.handle().clone();
pub(crate) async fn try_new(app: &tauri::App) -> anyhow::Result<Self> {
let data_dir = app.path().app_data_dir()?;
info!("Data directory is {data_dir:?}");

Expand Down
2 changes: 1 addition & 1 deletion packages/target-tauri/src-tauri/src/webxdc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Context;
use deltachat::accounts::Accounts;
use log::{error, info, trace};
use log::{error, info};
use tauri::{Manager, UriSchemeContext, UriSchemeResponder};

use crate::state::deltachat::DeltaChatAppState;
Expand Down

0 comments on commit c28ce66

Please sign in to comment.