chore(rustfmt): use nightly (#2325)

Stable rustfmt lacks a lot of features resulting in worse formatted
code, thus use nightly formatter.
This commit is contained in:
Kirill Chibisov 2024-04-26 19:11:44 +04:00 committed by GitHub
parent 7006c7ceca
commit 7b0c7b6cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
154 changed files with 3439 additions and 5891 deletions

View file

@ -1,27 +1,19 @@
use std::{
ffi::{c_void, OsString},
os::windows::prelude::OsStringExt,
ptr::null_mut,
};
use std::ffi::{c_void, OsString};
use std::os::windows::prelude::OsStringExt;
use std::ptr::null_mut;
use windows_sys::Win32::{
Foundation::{POINT, RECT},
Globalization::HIMC,
UI::{
Input::Ime::{
ImmAssociateContextEx, ImmGetCompositionStringW, ImmGetContext, ImmReleaseContext,
ImmSetCandidateWindow, ImmSetCompositionWindow, ATTR_TARGET_CONVERTED,
ATTR_TARGET_NOTCONVERTED, CANDIDATEFORM, CFS_EXCLUDE, CFS_POINT, COMPOSITIONFORM,
GCS_COMPATTR, GCS_COMPSTR, GCS_CURSORPOS, GCS_RESULTSTR, IACE_CHILDREN, IACE_DEFAULT,
},
WindowsAndMessaging::{GetSystemMetrics, SM_IMMENABLED},
},
use windows_sys::Win32::Foundation::{POINT, RECT};
use windows_sys::Win32::Globalization::HIMC;
use windows_sys::Win32::UI::Input::Ime::{
ImmAssociateContextEx, ImmGetCompositionStringW, ImmGetContext, ImmReleaseContext,
ImmSetCandidateWindow, ImmSetCompositionWindow, ATTR_TARGET_CONVERTED,
ATTR_TARGET_NOTCONVERTED, CANDIDATEFORM, CFS_EXCLUDE, CFS_POINT, COMPOSITIONFORM, GCS_COMPATTR,
GCS_COMPSTR, GCS_CURSORPOS, GCS_RESULTSTR, IACE_CHILDREN, IACE_DEFAULT,
};
use windows_sys::Win32::UI::WindowsAndMessaging::{GetSystemMetrics, SM_IMMENABLED};
use crate::{
dpi::{Position, Size},
platform::windows::HWND,
};
use crate::dpi::{Position, Size};
use crate::platform::windows::HWND;
pub struct ImeContext {
hwnd: HWND,
@ -60,7 +52,8 @@ impl ImeContext {
if first.is_some() && last.is_none() {
last = Some(text.len());
} else if first.is_none() {
// IME haven't split words and select any clause yet, so trying to retrieve normal cursor.
// IME haven't split words and select any clause yet, so trying to retrieve normal
// cursor.
let cursor = unsafe { self.get_composition_cursor(&text) };
first = cursor;
last = cursor;
@ -120,12 +113,7 @@ impl ImeContext {
let (x, y) = spot.to_physical::<i32>(scale_factor).into();
let (width, height): (i32, i32) = size.to_physical::<i32>(scale_factor).into();
let rc_area = RECT {
left: x,
top: y,
right: x + width,
bottom: y + height,
};
let rc_area = RECT { left: x, top: y, right: x + width, bottom: y + height };
let candidate_form = CANDIDATEFORM {
dwIndex: 0,
dwStyle: CFS_EXCLUDE,