Skip to content

Commit 2bad6d5

Browse files
committed
chore: Code format
1 parent a3476fd commit 2bad6d5

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

src-tauri/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ pub fn create_background_window() {
168168

169169
#[tauri::command]
170170
pub fn set_proxy(proxy: &str) -> Result<(), ()> {
171-
if proxy.is_empty(){
171+
if proxy.is_empty() {
172172
std::env::remove_var("http_proxy");
173173
std::env::remove_var("https_proxy");
174174
std::env::remove_var("all_proxy");
175-
}else{
175+
} else {
176176
std::env::set_var("http_proxy", proxy);
177177
std::env::set_var("https_proxy", proxy);
178178
std::env::set_var("all_proxy", proxy);

src-tauri/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn cut_screenshot(left: u32, top: u32, right: u32, bottom: u32, app_handle:
6969
match img2.to_image().save(&app_cache_dir_path) {
7070
Ok(_) => {}
7171
Err(e) => {
72-
println!("{}", e.to_string());
72+
println!("{:?}", e.to_string());
7373
}
7474
}
7575
}

src-tauri/src/window.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ fn get_current_monitor(x: f64, y: f64, util: Window) -> Result<Monitor, ()> {
164164
let size: tauri::LogicalSize<f64> = size.to_logical(dpi);
165165
size
166166
};
167-
168-
if x >= position.x as f64 && x <= (position.x as f64 + size.width as f64) {
169-
if y >= position.y as f64 && y <= (position.y as f64 + size.height as f64) {
170-
return Ok(m);
171-
}
167+
if x >= position.x as f64
168+
&& x <= (position.x as f64 + size.width as f64)
169+
&& y >= position.y as f64
170+
&& y <= (position.y as f64 + size.height as f64)
171+
{
172+
return Ok(m);
172173
}
173174
}
174175
Err(())

src/interfaces/deepl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async function translate_by_key(text, from, to, setText, id, key) {
113113
}
114114
let url = 'https://api-free.deepl.com/v2/translate';
115115
if (!key.endsWith(':fx')) {
116-
url = 'https://api.deepl.com/v2/translate'
116+
url = 'https://api.deepl.com/v2/translate';
117117
}
118118
let res = await fetch(url, {
119119
method: 'POST',

src/interfaces/openai.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ export async function translate(text, from, to, setText, id) {
9292
const headers =
9393
service === 'openai'
9494
? {
95-
'Content-Type': 'application/json',
96-
Authorization: `Bearer ${apikey}`,
97-
}
95+
'Content-Type': 'application/json',
96+
Authorization: `Bearer ${apikey}`,
97+
}
9898
: {
99-
'Content-Type': 'application/json',
100-
'api-key': apikey,
101-
};
99+
'Content-Type': 'application/json',
100+
'api-key': apikey,
101+
};
102102

103103
let body = {
104104
temperature: 0,

src/interfaces/utils/lang_detect.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export async function detect(text) {
2828
'Content-Type': 'application/x-www-form-urlencoded',
2929
},
3030
body: Body.form({
31-
query: text
32-
})
31+
query: text,
32+
}),
3333
});
3434
if (res.ok) {
3535
let result = res.data;

0 commit comments

Comments
 (0)