Skip to content

Commit 9ff82a9

Browse files
committed
fix (core): 修复代码错误引用
1 parent a6cba84 commit 9ff82a9

5 files changed

Lines changed: 8 additions & 11 deletions

File tree

src-tauri/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async fn execute_code(
6262
.map_err(|e| format!("Failed to write temporary file: {}", e))?;
6363

6464
let start_time = std::time::Instant::now();
65-
let mut last_error: String = String::new();
65+
let mut _last_error: String = String::new();
6666

6767
let cmd = plugin.get_command();
6868
let args = plugin.get_execute_args(file_path.to_str().unwrap());
@@ -119,7 +119,7 @@ async fn execute_code(
119119
return Ok(result);
120120
}
121121
Err(e) => {
122-
last_error = format!("Failed to execute {} - {}", cmd, e);
122+
_last_error = format!("Failed to execute {} - {}", cmd, e);
123123
}
124124
}
125125

@@ -141,7 +141,7 @@ async fn execute_code(
141141
"{} interpreter not found. Please install {} and ensure it's in your PATH.\n\nLast error: {}\n\nTried commands: {:?}",
142142
request.language,
143143
request.language,
144-
last_error,
144+
_last_error,
145145
plugin.get_command().to_string()
146146
),
147147
execution_time,
@@ -162,7 +162,7 @@ async fn get_info(
162162
.get_plugin(&language)
163163
.ok_or_else(|| format!("Unsupported language: {}", language))?;
164164

165-
plugin.pre_execute_hook(&String::new()).map_err(|e| {
165+
plugin.pre_execute_hook("").map_err(|e| {
166166
error!(
167167
"获取环境 -> 调用插件 [ {} ] pre_execute_hook 出现错误 {:?}",
168168
language, e

src-tauri/src/plugins/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{python2::Python2Plugin, python3::Python3Plugin, LanguagePlugin, PluginConfig};
1+
use super::{LanguagePlugin, PluginConfig, python2::Python2Plugin, python3::Python3Plugin};
22
use std::collections::HashMap;
33

44
pub struct PluginManager {

src-tauri/src/plugins/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub trait LanguagePlugin: Send + Sync {
6363
fn get_execute_home(&self) -> Option<PathBuf> {
6464
self.get_config()
6565
.and_then(|config| config.execute_home.clone())
66-
.map(|path| PathBuf::from(path))
66+
.map(PathBuf::from)
6767
}
6868

6969
// 获取插件支持的命令

src-tauri/src/setup/menus/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use log::info;
22
use tauri::{
3-
menu::{MenuItemBuilder, Submenu, SubmenuBuilder}, AppHandle,
4-
Emitter,
3+
AppHandle, Emitter,
4+
menu::{MenuItemBuilder, Submenu, SubmenuBuilder},
55
};
66

77
pub fn create_app_submenu(app: &AppHandle) -> tauri::Result<Submenu<tauri::Wry>> {

src/components/Settings.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import Modal from '../ui/Modal.vue'
2121
import Tabs from '../ui/Tabs.vue'
2222
import General from './setting/General.vue'
2323
import Language from './setting/Language.vue'
24-
import { useToast } from '../plugins/toast.ts'
2524
2625
const isVisible = ref(false)
2726
const activeTab = ref('general')
@@ -41,8 +40,6 @@ const closeSettings = () => {
4140
}, 300)
4241
}
4342
44-
const toast = useToast()
45-
4643
onMounted(async () => {
4744
// 延迟显示动画
4845
await nextTick()

0 commit comments

Comments
 (0)