Remove extern crate statements (#3310)

This commit is contained in:
daxpedda 2023-12-25 09:25:09 +01:00 committed by GitHub
parent 61a873d79a
commit 28a811bbba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 54 additions and 26 deletions

View file

@ -682,7 +682,7 @@ fn byte_slice_to_smol_str(bytes: &[u8]) -> Option<SmolStr> {
std::str::from_utf8(bytes)
.map(SmolStr::new)
.map_err(|e| {
warn!(
log::warn!(
"UTF-8 received from libxkbcommon ({:?}) was invalid: {e}",
bytes
)

View file

@ -712,7 +712,7 @@ unsafe extern "C" fn x_error_callback(
// Don't log error.
if !error_handled {
error!("X11 error: {:#?}", error);
log::error!("X11 error: {:#?}", error);
// XXX only update the error, if it wasn't handled by any of the hooks.
*xconn.latest_error.lock().unwrap() = Some(error);
}

View file

@ -552,7 +552,7 @@ impl<T: 'static> EventLoop<T> {
};
self.event_loop.dispatch(timeout, state).map_err(|error| {
error!("Error dispatching event loop: {}", error);
log::error!("Error dispatching event loop: {}", error);
error.into()
})
}

View file

@ -135,7 +135,7 @@ impl WinitState {
) {
Ok(c) => Some(c),
Err(e) => {
warn!("Subcompositor protocol not available, ignoring CSD: {e:?}");
log::warn!("Subcompositor protocol not available, ignoring CSD: {e:?}");
None
}
};

View file

@ -15,6 +15,8 @@ use sctk::shell::xdg::window::Window as SctkWindow;
use sctk::shell::xdg::window::WindowDecorations;
use sctk::shell::WaylandSurface;
use log::warn;
use crate::dpi::{LogicalSize, PhysicalPosition, PhysicalSize, Position, Size};
use crate::error::{ExternalError, NotSupportedError, OsError as RootOsError};
use crate::event::{Ime, WindowEvent};

View file

@ -86,7 +86,7 @@ extern "C" fn preedit_draw_callback(
let chg_range =
call_data.chg_first as usize..(call_data.chg_first + call_data.chg_length) as usize;
if chg_range.start > client_data.text.len() || chg_range.end > client_data.text.len() {
warn!(
log::warn!(
"invalid chg range: buffer length={}, but chg_first={} chg_lengthg={}",
client_data.text.len(),
call_data.chg_first,

View file

@ -10,6 +10,10 @@ use std::sync::{
Arc,
};
use log::debug;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use super::{ffi, util, XConnection, XError};
pub use self::context::ImeContextCreationError;

View file

@ -22,6 +22,7 @@ pub use self::xdisplay::{XError, XNotSupported};
use calloop::generic::Generic;
use calloop::EventLoop as Loop;
use calloop::{ping::Ping, Readiness};
use log::warn;
use std::{
cell::{Cell, RefCell},

View file

@ -1,5 +1,8 @@
use std::sync::Arc;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use super::*;
#[derive(Debug)]

View file

@ -45,7 +45,7 @@ impl XConnection {
self.flush_requests()?;
Ok(true)
} else {
error!("Could not select XKB events: The XKB extension is not initialized!");
log::error!("Could not select XKB events: The XKB extension is not initialized!");
Ok(false)
}
}

View file

@ -4,6 +4,7 @@ use super::*;
use crate::platform_impl::platform::x11::monitor;
use crate::{dpi::validate_scale_factor, platform_impl::platform::x11::VideoMode};
use log::warn;
use x11rb::protocol::randr::{self, ConnectionExt as _};
/// Represents values of `WINIT_HIDPI_FACTOR`.

View file

@ -7,6 +7,7 @@ use std::{
sync::{Arc, Mutex, MutexGuard},
};
use log::{debug, info, warn};
use x11rb::{
connection::Connection,
properties::{WmHints, WmHintsState, WmSizeHints, WmSizeHintsSpecification},