chore(deps): bump windows-rs from 0.33 to 0.34

This commit is contained in:
LGUG2Z
2022-03-18 16:43:22 -07:00
parent e46f1f4f6d
commit 3eade94032
10 changed files with 73 additions and 78 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ winreg = "0.10"
schemars = "0.8"
[dependencies.windows]
version = "0.33"
version = "0.34"
features = [
"Win32_Foundation",
"Win32_Graphics_Dwm",
+2 -5
View File
@@ -1,6 +1,5 @@
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::convert::TryInto;
use std::ffi::c_void;
use color_eyre::eyre::anyhow;
@@ -438,9 +437,7 @@ impl WindowsApi {
pub fn window_text_w(hwnd: HWND) -> Result<String> {
let mut text: [u16; 512] = [0; 512];
match WindowsResult::from(unsafe {
GetWindowTextW(hwnd, PWSTR(text.as_mut_ptr()), text.len().try_into()?)
}) {
match WindowsResult::from(unsafe { GetWindowTextW(hwnd, &mut text) }) {
WindowsResult::Ok(len) => {
let length = usize::try_from(len)?;
Ok(String::from_utf16(&text[..length])?)
@@ -495,7 +492,7 @@ impl WindowsApi {
let mut class: [u16; BUF_SIZE] = [0; BUF_SIZE];
let len = Result::from(WindowsResult::from(unsafe {
RealGetWindowClassW(hwnd, PWSTR(class.as_mut_ptr()), u32::try_from(BUF_SIZE)?)
RealGetWindowClassW(hwnd, &mut class)
}))?;
Ok(String::from_utf16(&class[0..len as usize])?)
+2
View File
@@ -1,3 +1,5 @@
#![allow(clippy::use_self)]
use schemars::JsonSchema;
use serde::Serialize;
use strum::Display;