1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 04:56:12 +03:00

encoding my preferred import grouping in the rustfmt config

This uses an unstable option in rustfmt, you `cargo +nightly fmt`
needs to be used to format the code correctly.
This commit is contained in:
Wez Furlong 2022-01-17 13:49:44 -07:00
parent 8f31aed3f1
commit e4ed2c93e2
46 changed files with 67 additions and 110 deletions

View File

@ -45,6 +45,6 @@ jobs:
- name: Build - name: Build
run: | run: |
source $HOME/.cargo/env source $HOME/.cargo/env
cargo fmt --all -- --check cargo +nightly fmt --all -- --check

View File

@ -1,4 +1,5 @@
# Please keep these in alphabetical order. # Please keep these in alphabetical order.
# https://github.com/rust-lang/rustfmt/issues/3149 # https://github.com/rust-lang/rustfmt/issues/3149
edition = "2018" edition = "2018"
imports_granularity = "Module"
tab_spaces = 4 tab_spaces = 4

View File

@ -2,10 +2,9 @@ use crate::background::Gradient;
use crate::bell::{AudibleBell, VisualBell}; use crate::bell::{AudibleBell, VisualBell};
use crate::color::{ColorSchemeFile, HsbTransform, Palette, TabBarStyle, WindowFrameConfig}; use crate::color::{ColorSchemeFile, HsbTransform, Palette, TabBarStyle, WindowFrameConfig};
use crate::daemon::DaemonOptions; use crate::daemon::DaemonOptions;
use crate::font::{AllowSquareGlyphOverflow, StyleRule, TextStyle};
use crate::font::{ use crate::font::{
FontLocatorSelection, FontRasterizerSelection, FontShaperSelection, FreeTypeLoadFlags, AllowSquareGlyphOverflow, FontLocatorSelection, FontRasterizerSelection, FontShaperSelection,
FreeTypeLoadTarget, FreeTypeLoadFlags, FreeTypeLoadTarget, StyleRule, TextStyle,
}; };
use crate::frontend::FrontEndSelection; use crate::frontend::FrontEndSelection;
use crate::keyassignment::{KeyAssignment, MouseEventTrigger, SpawnCommand}; use crate::keyassignment::{KeyAssignment, MouseEventTrigger, SpawnCommand};

View File

@ -1,7 +1,5 @@
use crate::de_notnan;
use crate::keys::KeyNoAction; use crate::keys::KeyNoAction;
use crate::ConfigHandle; use crate::{de_notnan, ConfigHandle, LeaderKey};
use crate::LeaderKey;
use luahelper::impl_lua_conversion; use luahelper::impl_lua_conversion;
use ordered_float::NotNan; use ordered_float::NotNan;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,5 @@
use crate::keyassignment::KeyAssignment; use crate::keyassignment::KeyAssignment;
use crate::Gradient; use crate::{FontAttributes, FontStretch, FontWeight, FreeTypeLoadTarget, Gradient, TextStyle};
use crate::{FontAttributes, FontStretch, FontWeight, FreeTypeLoadTarget, TextStyle};
use anyhow::anyhow; use anyhow::anyhow;
use bstr::BString; use bstr::BString;
pub use luahelper::*; pub use luahelper::*;

View File

@ -1,6 +1,5 @@
use std::env;
use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::{env, fs};
fn new_build() -> cc::Build { fn new_build() -> cc::Build {
let mut cfg = cc::Build::new(); let mut cfg = cc::Build::new();

View File

@ -8,9 +8,7 @@ use std::os::windows::prelude::*;
use std::ptr; use std::ptr;
use std::sync::Once; use std::sync::Once;
use std::time::Duration; use std::time::Duration;
use winapi::shared::ws2def::AF_INET; use winapi::shared::ws2def::{AF_INET, INADDR_LOOPBACK, SOCKADDR_IN};
use winapi::shared::ws2def::INADDR_LOOPBACK;
use winapi::shared::ws2def::SOCKADDR_IN;
use winapi::um::fileapi::*; use winapi::um::fileapi::*;
use winapi::um::handleapi::*; use winapi::um::handleapi::*;
use winapi::um::minwinbase::SECURITY_ATTRIBUTES; use winapi::um::minwinbase::SECURITY_ATTRIBUTES;

View File

@ -16,10 +16,8 @@ use crossbeam::channel::{unbounded as channel, Receiver, Sender};
use filedescriptor::{FileDescriptor, Pipe}; use filedescriptor::{FileDescriptor, Pipe};
use portable_pty::*; use portable_pty::*;
use rangeset::RangeSet; use rangeset::RangeSet;
use std::cell::RefCell; use std::cell::{RefCell, RefMut};
use std::cell::RefMut; use std::io::{BufWriter, Write};
use std::io::BufWriter;
use std::io::Write;
use std::ops::Range; use std::ops::Range;
use std::rc::Rc; use std::rc::Rc;
use std::sync::Arc; use std::sync::Arc;

View File

@ -4,13 +4,11 @@ use crate::pane::alloc_pane_id;
use crate::tab::{Tab, TabId}; use crate::tab::{Tab, TabId};
use crate::tmux::{TmuxDomain, TmuxDomainState, TmuxRemotePane, TmuxTab}; use crate::tmux::{TmuxDomain, TmuxDomainState, TmuxRemotePane, TmuxTab};
use crate::tmux_pty::TmuxPty; use crate::tmux_pty::TmuxPty;
use crate::Mux; use crate::{Mux, Pane};
use crate::Pane;
use anyhow::anyhow; use anyhow::anyhow;
use portable_pty::{MasterPty, PtySize}; use portable_pty::{MasterPty, PtySize};
use std::collections::HashSet; use std::collections::HashSet;
use std::fmt::Debug; use std::fmt::{Debug, Write};
use std::fmt::Write;
use std::rc::Rc; use std::rc::Rc;
use std::sync::{Arc, Condvar, Mutex}; use std::sync::{Arc, Condvar, Mutex};
use termwiz::tmux_cc::*; use termwiz::tmux_cc::*;

View File

@ -1,12 +1,8 @@
use crate::{ use crate::tmux::{RefTmuxRemotePane, TmuxCmdQueue, TmuxDomainState};
tmux::{RefTmuxRemotePane, TmuxCmdQueue, TmuxDomainState}, use crate::tmux_commands::SendKeys;
tmux_commands::SendKeys,
};
use portable_pty::{Child, ChildKiller, ExitStatus, MasterPty}; use portable_pty::{Child, ChildKiller, ExitStatus, MasterPty};
use std::{ use std::io::{Read, Write};
io::{Read, Write}, use std::sync::{Arc, Condvar, Mutex};
sync::{Arc, Condvar, Mutex},
};
pub(crate) struct TmuxReader { pub(crate) struct TmuxReader {
rx: flume::Receiver<String>, rx: flume::Receiver<String>,

View File

@ -15,8 +15,7 @@ use serial::{
BaudRate, CharSize, FlowControl, Parity, PortSettings, SerialPort, StopBits, SystemPort, BaudRate, CharSize, FlowControl, Parity, PortSettings, SerialPort, StopBits, SystemPort,
}; };
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::io::Result as IoResult; use std::io::{Read, Result as IoResult, Write};
use std::io::{Read, Write};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::time::Duration; use std::time::Duration;

View File

@ -11,8 +11,7 @@ use crate::{
use filedescriptor::{AsRawSocketDescriptor, POLLIN}; use filedescriptor::{AsRawSocketDescriptor, POLLIN};
use ssh2::{Channel, Session}; use ssh2::{Channel, Session};
use std::collections::HashMap; use std::collections::HashMap;
use std::io::Result as IoResult; use std::io::{Read, Result as IoResult, Write};
use std::io::{Read, Write};
use std::sync::{Arc, Condvar, Mutex}; use std::sync::{Arc, Condvar, Mutex};
/// Represents a pty channel within a session. /// Represents a pty channel within a session.

View File

@ -4,12 +4,10 @@ use crate::{Child, CommandBuilder, MasterPty, PtyPair, PtySize, PtySystem, Slave
use anyhow::{bail, Error}; use anyhow::{bail, Error};
use filedescriptor::FileDescriptor; use filedescriptor::FileDescriptor;
use libc::{self, winsize}; use libc::{self, winsize};
use std::io;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::mem;
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
use std::os::unix::process::CommandExt; use std::os::unix::process::CommandExt;
use std::ptr; use std::{io, mem, ptr};
#[derive(Default)] #[derive(Default)]
pub struct UnixPtySystem {} pub struct UnixPtySystem {}

View File

@ -1,8 +1,7 @@
use crate::win::psuedocon::HPCON; use crate::win::psuedocon::HPCON;
use anyhow::{ensure, Error}; use anyhow::{ensure, Error};
use std::io::Error as IoError; use std::io::Error as IoError;
use std::mem; use std::{mem, ptr};
use std::ptr;
use winapi::shared::minwindef::DWORD; use winapi::shared::minwindef::DWORD;
use winapi::um::processthreadsapi::*; use winapi::um::processthreadsapi::*;

View File

@ -7,12 +7,11 @@ use lazy_static::lazy_static;
use shared_library::shared_library; use shared_library::shared_library;
use std::ffi::OsString; use std::ffi::OsString;
use std::io::Error as IoError; use std::io::Error as IoError;
use std::mem;
use std::os::windows::ffi::OsStringExt; use std::os::windows::ffi::OsStringExt;
use std::os::windows::io::{AsRawHandle, FromRawHandle}; use std::os::windows::io::{AsRawHandle, FromRawHandle};
use std::path::Path; use std::path::Path;
use std::ptr;
use std::sync::Mutex; use std::sync::Mutex;
use std::{mem, ptr};
use winapi::shared::minwindef::DWORD; use winapi::shared::minwindef::DWORD;
use winapi::shared::winerror::{HRESULT, S_OK}; use winapi::shared::winerror::{HRESULT, S_OK};
use winapi::um::handleapi::*; use winapi::um::handleapi::*;

View File

@ -9,8 +9,7 @@ use super::VisibleRowIndex;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
pub use termwiz::input::KeyCode; pub use termwiz::input::{KeyCode, Modifiers as KeyModifiers};
pub use termwiz::input::Modifiers as KeyModifiers;
#[cfg_attr(feature = "use_serde", derive(Deserialize, Serialize))] #[cfg_attr(feature = "use_serde", derive(Deserialize, Serialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

View File

@ -8,9 +8,8 @@ use anyhow::Context;
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use termwiz::escape::apc::KittyImageData;
use termwiz::escape::apc::{ use termwiz::escape::apc::{
KittyFrameCompositionMode, KittyImage, KittyImageCompression, KittyImageDelete, KittyFrameCompositionMode, KittyImage, KittyImageCompression, KittyImageData, KittyImageDelete,
KittyImageFormat, KittyImageFrame, KittyImageFrameCompose, KittyImagePlacement, KittyImageFormat, KittyImageFrame, KittyImageFrameCompose, KittyImagePlacement,
KittyImageTransmit, KittyImageVerbosity, KittyImageTransmit, KittyImageVerbosity,
}; };

View File

@ -2,8 +2,7 @@ use crate::terminal::Alert;
use crate::terminalstate::{ use crate::terminalstate::{
default_color_map, CharSet, MouseEncoding, TabStop, UnicodeVersionStackEntry, default_color_map, CharSet, MouseEncoding, TabStop, UnicodeVersionStackEntry,
}; };
use crate::{ClipboardSelection, Position, TerminalState, VisibleRowIndex}; use crate::{ClipboardSelection, Position, TerminalState, VisibleRowIndex, DCS, ST};
use crate::{DCS, ST};
use log::{debug, error}; use log::{debug, error};
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use std::fmt::Write; use std::fmt::Write;

View File

@ -18,8 +18,7 @@ pub mod parser;
pub use self::apc::KittyImage; pub use self::apc::KittyImage;
pub use self::csi::CSI; pub use self::csi::CSI;
pub use self::esc::Esc; pub use self::esc::{Esc, EscCode};
pub use self::esc::EscCode;
pub use self::osc::OperatingSystemCommand; pub use self::osc::OperatingSystemCommand;
use vtparse::CsiParam; use vtparse::CsiParam;

View File

@ -696,8 +696,7 @@ mod test {
use crate::escape::{Action, Esc, EscCode}; use crate::escape::{Action, Esc, EscCode};
use crate::input::InputEvent; use crate::input::InputEvent;
use crate::terminal::unix::{Purge, SetAttributeWhen, UnixTty}; use crate::terminal::unix::{Purge, SetAttributeWhen, UnixTty};
use crate::terminal::ScreenSize; use crate::terminal::{cast, ScreenSize, Terminal, TerminalWaker};
use crate::terminal::{cast, Terminal, TerminalWaker};
use libc::winsize; use libc::winsize;
use std::io::{Error as IoError, ErrorKind, Read, Result as IoResult, Write}; use std::io::{Error as IoError, ErrorKind, Read, Result as IoResult, Write};
use std::mem; use std::mem;

View File

@ -24,8 +24,7 @@ use std::collections::HashMap;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::marker::Unpin; use std::marker::Unpin;
use std::net::TcpStream; use std::net::TcpStream;
use std::path::Path; use std::path::{Path, PathBuf};
use std::path::PathBuf;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
use thiserror::Error; use thiserror::Error;

View File

@ -13,8 +13,7 @@ use mux::{Mux, MuxNotification};
use portable_pty::PtySize; use portable_pty::PtySize;
use rangeset::RangeSet; use rangeset::RangeSet;
use ratelim::RateLimiter; use ratelim::RateLimiter;
use std::cell::RefCell; use std::cell::{RefCell, RefMut};
use std::cell::RefMut;
use std::collections::HashMap; use std::collections::HashMap;
use std::ops::Range; use std::ops::Range;
use std::rc::Rc; use std::rc::Rc;

View File

@ -19,8 +19,7 @@ use termwiz::cell::{Cell, CellAttributes, Underline};
use termwiz::color::AnsiColor; use termwiz::color::AnsiColor;
use termwiz::surface::{SequenceNo, SEQ_ZERO}; use termwiz::surface::{SequenceNo, SEQ_ZERO};
use url::Url; use url::Url;
use wezterm_term::{KeyCode, KeyModifiers}; use wezterm_term::{KeyCode, KeyModifiers, Line, StableRowIndex};
use wezterm_term::{Line, StableRowIndex};
const MAX_POLL_INTERVAL: Duration = Duration::from_secs(30); const MAX_POLL_INTERVAL: Duration = Duration::from_secs(30);
const BASE_POLL_INTERVAL: Duration = Duration::from_millis(20); const BASE_POLL_INTERVAL: Duration = Duration::from_millis(20);

View File

@ -5,10 +5,8 @@ use anyhow::{anyhow, ensure, Error};
use config::{FontStretch, FontWeight}; use config::{FontStretch, FontWeight};
pub use fontconfig::*; pub use fontconfig::*;
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use std::fmt;
use std::mem;
use std::os::raw::{c_char, c_int}; use std::os::raw::{c_char, c_int};
use std::ptr; use std::{fmt, mem, ptr};
pub const FC_MONO: i32 = 100; pub const FC_MONO: i32 = 100;
pub const FC_DUAL: i32 = 90; pub const FC_DUAL: i32 = 90;

View File

@ -4,9 +4,8 @@ use freetype;
pub use harfbuzz::*; pub use harfbuzz::*;
use anyhow::{ensure, Error}; use anyhow::{ensure, Error};
use std::mem;
use std::os::raw::c_char; use std::os::raw::c_char;
use std::slice; use std::{mem, slice};
extern "C" { extern "C" {
fn hb_ft_font_set_load_flags(font: *mut hb_font_t, load_flags: i32); fn hb_ft_font_set_load_flags(font: *mut hb_font_t, load_flags: i32);

View File

@ -7,8 +7,7 @@ use anyhow::bail;
use color_types::linear_u8_to_srgb8; use color_types::linear_u8_to_srgb8;
use config::{FreeTypeLoadFlags, FreeTypeLoadTarget}; use config::{FreeTypeLoadFlags, FreeTypeLoadTarget};
use std::cell::RefCell; use std::cell::RefCell;
use std::mem; use std::{mem, slice};
use std::slice;
pub struct FreeTypeRasterizer { pub struct FreeTypeRasterizer {
has_color: bool, has_color: bool,

View File

@ -1,8 +1,7 @@
use crate::ftwrap;
use crate::hbwrap as harfbuzz;
use crate::parser::ParsedFont; use crate::parser::ParsedFont;
use crate::shaper::{FallbackIdx, FontMetrics, FontShaper, GlyphInfo}; use crate::shaper::{FallbackIdx, FontMetrics, FontShaper, GlyphInfo};
use crate::units::*; use crate::units::*;
use crate::{ftwrap, hbwrap as harfbuzz};
use anyhow::{anyhow, Context}; use anyhow::{anyhow, Context};
use config::ConfigHandle; use config::ConfigHandle;
use log::error; use log::error;

View File

@ -6,11 +6,10 @@ use ::window::bitmaps::atlas::{Atlas, OutOfTextureSpace, Sprite};
use ::window::bitmaps::ImageTexture; use ::window::bitmaps::ImageTexture;
use ::window::bitmaps::{BitmapImage, Image, Texture2d}; use ::window::bitmaps::{BitmapImage, Image, Texture2d};
use ::window::color::SrgbaPixel; use ::window::color::SrgbaPixel;
use ::window::glium;
use ::window::glium::backend::Context as GliumContext; use ::window::glium::backend::Context as GliumContext;
use ::window::glium::texture::SrgbTexture2d; use ::window::glium::texture::SrgbTexture2d;
use ::window::glium::CapabilitiesSource; use ::window::glium::CapabilitiesSource;
use ::window::{Point, Rect}; use ::window::{glium, Point, Rect};
use anyhow::Context; use anyhow::Context;
use config::{AllowSquareGlyphOverflow, TextStyle}; use config::{AllowSquareGlyphOverflow, TextStyle};
use euclid::num::Zero; use euclid::num::Zero;

View File

@ -42,9 +42,7 @@ mod update;
mod utilsprites; mod utilsprites;
pub use selection::SelectionMode; pub use selection::SelectionMode;
pub use termwindow::set_window_class; pub use termwindow::{set_window_class, TermWindow, ICON_DATA};
pub use termwindow::TermWindow;
pub use termwindow::ICON_DATA;
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]
#[structopt( #[structopt(

View File

@ -13,10 +13,9 @@ mod launcher;
mod quickselect; mod quickselect;
mod search; mod search;
pub use confirm_close_pane::confirm_close_pane; pub use confirm_close_pane::{
pub use confirm_close_pane::confirm_close_tab; confirm_close_pane, confirm_close_tab, confirm_close_window, confirm_quit_program,
pub use confirm_close_pane::confirm_close_window; };
pub use confirm_close_pane::confirm_quit_program;
pub use copy::CopyOverlay; pub use copy::CopyOverlay;
pub use debug::show_debug_overlay; pub use debug::show_debug_overlay;
pub use launcher::{launcher, LauncherArgs, LauncherFlags}; pub use launcher::{launcher, LauncherArgs, LauncherFlags};

View File

@ -250,16 +250,14 @@ impl<'a> std::hash::Hash for (dyn ShapeCacheKeyTrait + 'a) {
mod test { mod test {
use super::*; use super::*;
use crate::glyphcache::GlyphCache; use crate::glyphcache::GlyphCache;
use crate::shapecache::GlyphPosition; use crate::shapecache::{GlyphPosition, ShapedInfo};
use crate::shapecache::ShapedInfo;
use crate::utilsprites::RenderMetrics; use crate::utilsprites::RenderMetrics;
use config::{FontAttributes, TextStyle}; use config::{FontAttributes, TextStyle};
use k9::assert_equal as assert_eq; use k9::assert_equal as assert_eq;
use std::rc::Rc; use std::rc::Rc;
use termwiz::cell::CellAttributes; use termwiz::cell::CellAttributes;
use termwiz::surface::{Line, SEQ_ZERO}; use termwiz::surface::{Line, SEQ_ZERO};
use wezterm_font::FontConfiguration; use wezterm_font::{FontConfiguration, LoadedFont};
use wezterm_font::LoadedFont;
fn cluster_and_shape<T>( fn cluster_and_shape<T>(
render_metrics: &RenderMetrics, render_metrics: &RenderMetrics,

View File

@ -2,8 +2,7 @@ use crate::termwindow::{PaneInformation, TabInformation, UIItem, UIItemType};
use config::lua::{format_as_escapes, FormatItem}; use config::lua::{format_as_escapes, FormatItem};
use config::{ConfigHandle, TabBarColors}; use config::{ConfigHandle, TabBarColors};
use mlua::FromLua; use mlua::FromLua;
use termwiz::cell::unicode_column_width; use termwiz::cell::{unicode_column_width, Cell, CellAttributes};
use termwiz::cell::{Cell, CellAttributes};
use termwiz::color::ColorSpec; use termwiz::color::ColorSpec;
use termwiz::escape::csi::Sgr; use termwiz::escape::csi::Sgr;
use termwiz::escape::parser::Parser; use termwiz::escape::parser::Parser;

View File

@ -17,8 +17,7 @@ use crate::shapecache::*;
use crate::tabbar::{TabBarItem, TabBarState}; use crate::tabbar::{TabBarItem, TabBarState};
use ::wezterm_term::input::MouseButton as TMB; use ::wezterm_term::input::MouseButton as TMB;
use ::window::*; use ::window::*;
use anyhow::Context; use anyhow::{anyhow, ensure, Context};
use anyhow::{anyhow, ensure};
use config::keyassignment::{ use config::keyassignment::{
ClipboardCopyDestination, ClipboardPasteSource, InputMap, KeyAssignment, QuickSelectArguments, ClipboardCopyDestination, ClipboardPasteSource, InputMap, KeyAssignment, QuickSelectArguments,
SpawnCommand, SpawnCommand,

View File

@ -1,6 +1,5 @@
use super::box_model::*; use super::box_model::*;
use crate::customglyph::BlockKey; use crate::customglyph::{BlockKey, *};
use crate::customglyph::*;
use crate::glium::texture::SrgbTexture2d; use crate::glium::texture::SrgbTexture2d;
use crate::glyphcache::{CachedGlyph, GlyphCache}; use crate::glyphcache::{CachedGlyph, GlyphCache};
use crate::quad::Quad; use crate::quad::Quad;
@ -13,12 +12,11 @@ use crate::termwindow::{
use crate::utilsprites::RenderMetrics; use crate::utilsprites::RenderMetrics;
use ::window::bitmaps::atlas::OutOfTextureSpace; use ::window::bitmaps::atlas::OutOfTextureSpace;
use ::window::bitmaps::{TextureCoord, TextureRect, TextureSize}; use ::window::bitmaps::{TextureCoord, TextureRect, TextureSize};
use ::window::glium;
use ::window::glium::uniforms::{ use ::window::glium::uniforms::{
MagnifySamplerFilter, MinifySamplerFilter, Sampler, SamplerWrapFunction, MagnifySamplerFilter, MinifySamplerFilter, Sampler, SamplerWrapFunction,
}; };
use ::window::glium::{uniform, BlendingFunction, LinearBlendingFactor, Surface}; use ::window::glium::{uniform, BlendingFunction, LinearBlendingFactor, Surface};
use ::window::{DeadKeyStatus, PointF, RectF, SizeF, WindowOps}; use ::window::{glium, DeadKeyStatus, PointF, RectF, SizeF, WindowOps};
use anyhow::anyhow; use anyhow::anyhow;
use config::{ use config::{
ConfigHandle, Dimension, DimensionContext, HsbTransform, TabBarColors, TextStyle, ConfigHandle, Dimension, DimensionContext, HsbTransform, TabBarColors, TextStyle,

View File

@ -1,7 +1,6 @@
use crate::ICON_DATA; use crate::ICON_DATA;
use anyhow::anyhow; use anyhow::anyhow;
use config::configuration; use config::{configuration, wezterm_version};
use config::wezterm_version;
use http_req::request::{HttpVersion, Request}; use http_req::request::{HttpVersion, Request};
use http_req::uri::Uri; use http_req::uri::Uri;
use mux::connui::ConnectionUI; use mux::connui::ConnectionUI;

View File

@ -4,8 +4,7 @@ use crate::sessionwrap::SessionWrap;
use filedescriptor::{socketpair, FileDescriptor}; use filedescriptor::{socketpair, FileDescriptor};
use portable_pty::{ExitStatus, PtySize}; use portable_pty::{ExitStatus, PtySize};
use smol::channel::{bounded, Receiver, TryRecvError}; use smol::channel::{bounded, Receiver, TryRecvError};
use std::collections::HashMap; use std::collections::{HashMap, VecDeque};
use std::collections::VecDeque;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::sync::Mutex; use std::sync::Mutex;

View File

@ -1,11 +1,10 @@
use super::{Metadata, SessionRequest, SessionSender, SftpChannelResult, SftpRequest}; use super::{Metadata, SessionRequest, SessionSender, SftpChannelResult, SftpRequest};
use smol::channel::{bounded, Sender}; use smol::channel::{bounded, Sender};
use smol::future::FutureExt; use smol::future::FutureExt;
use std::fmt;
use std::future::Future; use std::future::Future;
use std::io;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use std::{fmt, io};
pub(crate) type FileId = usize; pub(crate) type FileId = usize;

View File

@ -1,5 +1,6 @@
use crate::sshd::session; use crate::sshd::session;
use assert_fs::{prelude::*, TempDir}; use assert_fs::prelude::*;
use assert_fs::TempDir;
use predicates::prelude::*; use predicates::prelude::*;
use rstest::*; use rstest::*;
use std::convert::TryInto; use std::convert::TryInto;

View File

@ -1,5 +1,6 @@
use crate::sshd::session; use crate::sshd::session;
use assert_fs::{prelude::*, TempDir}; use assert_fs::prelude::*;
use assert_fs::TempDir;
use rstest::*; use rstest::*;
use smol::io::{AsyncReadExt, AsyncWriteExt}; use smol::io::{AsyncReadExt, AsyncWriteExt};
use std::convert::TryInto; use std::convert::TryInto;

View File

@ -1,4 +1,5 @@
use assert_fs::{prelude::*, TempDir}; use assert_fs::prelude::*;
use assert_fs::TempDir;
use once_cell::sync::{Lazy, OnceCell}; use once_cell::sync::{Lazy, OnceCell};
use rstest::*; use rstest::*;
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -8,9 +8,9 @@ mod bindings {
::windows::include_bindings!(); ::windows::include_bindings!();
} }
use bindings::{ use bindings::Windows::Data::Xml::Dom::XmlDocument;
Windows::Data::Xml::Dom::XmlDocument, Windows::Foundation::*, Windows::UI::Notifications::*, use bindings::Windows::Foundation::*;
}; use bindings::Windows::UI::Notifications::*;
use windows::{Error as WinError, IInspectable, Interface}; use windows::{Error as WinError, IInspectable, Interface};
fn unwrap_arg<T>(a: &Option<T>) -> Result<&T, WinError> { fn unwrap_arg<T>(a: &Option<T>) -> Result<&T, WinError> {

View File

@ -10,7 +10,8 @@ use std::rc::Rc;
use winapi::um::winbase::INFINITE; use winapi::um::winbase::INFINITE;
use winapi::um::winnt::HANDLE; use winapi::um::winnt::HANDLE;
use winapi::um::winuser::*; use winapi::um::winuser::*;
use winreg::{enums::HKEY_CURRENT_USER, RegKey}; use winreg::enums::HKEY_CURRENT_USER;
use winreg::RegKey;
pub struct Connection { pub struct Connection {
event_handle: HANDLE, event_handle: HANDLE,

View File

@ -23,7 +23,8 @@ pub fn is_running_in_rdp_session() -> bool {
use winapi::shared::minwindef::DWORD; use winapi::shared::minwindef::DWORD;
use winapi::um::processthreadsapi::{GetCurrentProcessId, ProcessIdToSessionId}; use winapi::um::processthreadsapi::{GetCurrentProcessId, ProcessIdToSessionId};
use winapi::um::winuser::{GetSystemMetrics, SM_REMOTESESSION}; use winapi::um::winuser::{GetSystemMetrics, SM_REMOTESESSION};
use winreg::{enums::HKEY_LOCAL_MACHINE, RegKey}; use winreg::enums::HKEY_LOCAL_MACHINE;
use winreg::RegKey;
if unsafe { GetSystemMetrics(SM_REMOTESESSION) } != 0 { if unsafe { GetSystemMetrics(SM_REMOTESESSION) } != 0 {
return true; return true;

View File

@ -5,8 +5,7 @@ use std::io::Error as IoError;
use std::os::raw::c_void; use std::os::raw::c_void;
use std::ptr::{null, null_mut}; use std::ptr::{null, null_mut};
use winapi::shared::windef::*; use winapi::shared::windef::*;
use winapi::um::libloaderapi::GetModuleHandleW; use winapi::um::libloaderapi::{GetModuleHandleW, *};
use winapi::um::libloaderapi::*;
use winapi::um::wingdi::*; use winapi::um::wingdi::*;
use winapi::um::winuser::*; use winapi::um::winuser::*;

View File

@ -1,10 +1,9 @@
use super::*; use super::*;
use crate::connection::ConnectionOps; use crate::connection::ConnectionOps;
use crate::Appearance;
use crate::{ use crate::{
Clipboard, DeadKeyStatus, Dimensions, Handled, KeyCode, KeyEvent, Modifiers, MouseButtons, Appearance, Clipboard, DeadKeyStatus, Dimensions, Handled, KeyCode, KeyEvent, Modifiers,
MouseCursor, MouseEvent, MouseEventKind, MousePress, Point, RawKeyEvent, Rect, ScreenPoint, MouseButtons, MouseCursor, MouseEvent, MouseEventKind, MousePress, Point, RawKeyEvent, Rect,
WindowDecorations, WindowEvent, WindowEventSender, WindowOps, WindowState, ScreenPoint, WindowDecorations, WindowEvent, WindowEventSender, WindowOps, WindowState,
}; };
use anyhow::{bail, Context}; use anyhow::{bail, Context};
use async_trait::async_trait; use async_trait::async_trait;
@ -35,7 +34,8 @@ use winapi::um::uxtheme::{
}; };
use winapi::um::wingdi::LOGFONTW; use winapi::um::wingdi::LOGFONTW;
use winapi::um::winuser::*; use winapi::um::winuser::*;
use winreg::{enums::HKEY_CURRENT_USER, RegKey}; use winreg::enums::HKEY_CURRENT_USER;
use winreg::RegKey;
const GCS_RESULTSTR: DWORD = 0x800; const GCS_RESULTSTR: DWORD = 0x800;
const GCS_COMPSTR: DWORD = 0x8; const GCS_COMPSTR: DWORD = 0x8;

View File

@ -1,8 +1,7 @@
use super::*; use super::*;
use crate::bitmaps::*; use crate::bitmaps::*;
use crate::connection::ConnectionOps; use crate::connection::ConnectionOps;
use crate::os::xkeysyms; use crate::os::{xkeysyms, Connection, Window};
use crate::os::{Connection, Window};
use crate::{ use crate::{
Appearance, Clipboard, DeadKeyStatus, Dimensions, MouseButtons, MouseCursor, MouseEvent, Appearance, Clipboard, DeadKeyStatus, Dimensions, MouseButtons, MouseCursor, MouseEvent,
MouseEventKind, MousePress, Point, Rect, ScreenPoint, WindowDecorations, WindowEvent, MouseEventKind, MousePress, Point, Rect, ScreenPoint, WindowDecorations, WindowEvent,