Remove parking_lot dependency (#2423)

This commit is contained in:
Mads Marquart 2022-08-31 18:32:19 +02:00 committed by GitHub
parent ec7e935248
commit 8729119536
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 197 additions and 175 deletions

View file

@ -1,7 +1,4 @@
use std::{collections::HashMap, error::Error, fmt, os::raw::c_int, ptr};
use libc;
use parking_lot::Mutex;
use std::{collections::HashMap, error::Error, fmt, os::raw::c_int, ptr, sync::Mutex};
use crate::window::CursorIcon;
@ -74,7 +71,7 @@ impl XConnection {
/// Checks whether an error has been triggered by the previous function calls.
#[inline]
pub fn check_errors(&self) -> Result<(), XError> {
let error = self.latest_error.lock().take();
let error = self.latest_error.lock().unwrap().take();
if let Some(error) = error {
Err(error)
} else {
@ -85,7 +82,7 @@ impl XConnection {
/// Ignores any previous error.
#[inline]
pub fn ignore_error(&self) {
*self.latest_error.lock() = None;
*self.latest_error.lock().unwrap() = None;
}
}