Skip to content

Commit

Permalink
删除未使用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
itxve committed Jan 5, 2023
1 parent c85ec20 commit 5783310
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 31 deletions.
3 changes: 3 additions & 0 deletions UPDATE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Updater Log

## v3.0.4
移出未使用代码

## v3.0.3

添加自动更新
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/live2d/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused)]

pub const JY_CONFIG_FILE: &'static str = "root_meta_info.json";
pub const APP_CONFIG_FILE: &'static str = "app.config.json";
pub const JY_FILE_CHANGE: &'static str = "jy_file_change";
4 changes: 2 additions & 2 deletions src-tauri/src/live2d/menu.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use tauri::{
AppHandle, CustomMenuItem, Manager, Menu, SystemTray, SystemTrayEvent, SystemTrayMenu,
SystemTrayMenuItem, WindowMenuEvent, Wry,
AppHandle, CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu,
SystemTrayMenuItem, Wry,
};

/// system tray
Expand Down
10 changes: 2 additions & 8 deletions src-tauri/src/live2d/my_command.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
use crate::config;
use crate::live2d::mstruct::{AppDataConfig, InitType, Rt};
use anyhow::Result;
use notify::{RecursiveMode, Watcher};
use std::sync::mpsc::channel;
use std::{fs, io::Read, path::PathBuf};
use tauri::updater::UpdateResponse;
use tauri::{AppHandle, Manager, SystemTrayMenuItem, WindowMenuEvent, Wry};
use crate::live2d::mstruct::{InitType, Rt};
use std::fs;

#[tauri::command]
pub fn read_file(file_path: std::path::PathBuf) -> Rt<Vec<u8>> {
Expand Down
5 changes: 2 additions & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
#![warn(unused_must_use)]
mod live2d;
mod plugins;

use live2d::{config, my_command};
use tauri::{generate_context, Manager};
use live2d::my_command;
use tauri::generate_context;

#[tauri::command(main)]
fn main() {
Expand Down
9 changes: 3 additions & 6 deletions src-tauri/src/plugins/checkupdate.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use anyhow::Result;
use tauri::plugin::{Builder, TauriPlugin};
use tauri::updater::UpdateResponse;
use tauri::{
plugin::{Builder, TauriPlugin},
Runtime,
};
use tauri::{AppHandle, EventLoopMessage, Manager, Wry};
use tauri::{AppHandle, Manager, Wry};

#[tauri::command]
pub fn run_check_update(app: AppHandle<Wry>) -> () {
Expand Down Expand Up @@ -71,7 +68,7 @@ Release Notes:
pub fn init() -> TauriPlugin<Wry> {
Builder::new("checkupdate")
.invoke_handler(tauri::generate_handler![run_check_update])
.setup(move |app| {
.setup(move |_app| {
println!("TauriPlugin [checkupdate] ");
Ok(())
})
Expand Down
16 changes: 4 additions & 12 deletions src-tauri/src/plugins/modelserve.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
use axum::handler::HandlerWithoutStateExt;
use axum::{
http::StatusCode,
response::IntoResponse,
routing::{get, get_service},
Router,
};
use axum::{http::StatusCode, response::IntoResponse, routing::get_service, Router};

use axum_server::Handle;
use std::fs;
use std::net::SocketAddr;
use tauri::api::http;
use tauri::{
plugin::{Builder, TauriPlugin},
Runtime,
};
use tauri::{window, AppHandle, Manager};
use tauri::{window, Manager};
use tower::ServiceExt;
use tower_http::cors::{Any, CorsLayer};
use tower_http::{services::ServeDir, trace::TraceLayer};
Expand Down Expand Up @@ -62,8 +56,6 @@ pub async fn _serve(serve_dir: &str) {
.handle_error(handle_error),
)
}

println!("app router:{:?}", &app);
axum_server::bind(SocketAddr::from(([127, 0, 0, 1], 13004)))
.handle(handle)
.serve(
Expand Down Expand Up @@ -164,11 +156,11 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
server_running,
shutdown_cmd
])
.setup(move |app| {
.setup(move |_app| {
println!("TauriPlugin [modelserver] ");
Ok(())
})
.on_page_load(|window, payload| {
.on_page_load(|window, _payload| {
let app_data_path = tauri::api::path::app_config_dir(&window.config()).unwrap();
let config_path = app_data_path.join(config::APP_CONFIG_FILE);
if config_path.exists() {
Expand Down

0 comments on commit 5783310

Please sign in to comment.