mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Remove macro use extern crates
Since the Rust 2018 edition allows importing macros directly, all uses of `#[macro_use] extern crate` have been removed from the linux build. The `log` and `serde` crate have been excluded from that right now, since they are so frequently used in the codebase.
This commit is contained in:
parent
7ec36f2626
commit
c01a383d1a
6 changed files with 18 additions and 21 deletions
|
@ -12,7 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
use ::log;
|
||||
use clap::{Arg, App};
|
||||
use clap::{Arg, App, crate_name, crate_version, crate_authors, crate_description};
|
||||
|
||||
use crate::index::{Line, Column};
|
||||
use crate::config::{Dimensions, Shell};
|
||||
use crate::window::{DEFAULT_TITLE, DEFAULT_CLASS};
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
|
||||
use static_assertions::assert_eq_size;
|
||||
|
||||
use crate::index::Line;
|
||||
use super::Row;
|
||||
|
||||
|
|
|
@ -17,11 +17,8 @@
|
|||
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
|
||||
#![cfg_attr(all(test, feature = "bench"), feature(test))]
|
||||
|
||||
#[macro_use] extern crate bitflags;
|
||||
#[macro_use] extern crate clap;
|
||||
#[macro_use] extern crate log;
|
||||
#[macro_use] extern crate serde_derive;
|
||||
#[macro_use] extern crate static_assertions;
|
||||
|
||||
#[cfg(windows)]
|
||||
extern crate mio_named_pipes;
|
||||
|
@ -40,7 +37,6 @@ extern crate objc;
|
|||
|
||||
#[macro_use]
|
||||
pub mod macros;
|
||||
|
||||
pub mod ansi;
|
||||
pub mod cli;
|
||||
pub mod config;
|
||||
|
|
26
src/main.rs
26
src/main.rs
|
@ -23,13 +23,13 @@
|
|||
// See https://msdn.microsoft.com/en-us/library/4cc7ya5b.aspx for more details.
|
||||
#![windows_subsystem = "windows"]
|
||||
|
||||
#[macro_use]
|
||||
extern crate alacritty;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate dirs;
|
||||
use dirs;
|
||||
|
||||
#[cfg(windows)]
|
||||
use winapi::um::wincon::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
|
||||
|
||||
use log::{info, error};
|
||||
|
||||
use std::error::Error;
|
||||
use std::sync::Arc;
|
||||
|
@ -40,18 +40,12 @@ use std::env;
|
|||
#[cfg(not(windows))]
|
||||
use std::os::unix::io::AsRawFd;
|
||||
|
||||
#[cfg(windows)]
|
||||
extern crate winapi;
|
||||
#[cfg(windows)]
|
||||
use winapi::um::wincon::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
|
||||
|
||||
use alacritty::cli;
|
||||
use alacritty::config::{self, Config, Error as ConfigError};
|
||||
use alacritty::display::Display;
|
||||
use alacritty::event;
|
||||
use alacritty::event_loop::{self, EventLoop, Msg};
|
||||
#[cfg(target_os = "macos")]
|
||||
use alacritty::locale;
|
||||
use alacritty::{cli, event, die};
|
||||
use alacritty::config::{self, Config, Error as ConfigError};
|
||||
use alacritty::display::Display;
|
||||
use alacritty::event_loop::{self, EventLoop, Msg};
|
||||
use alacritty::logging::{self, LoggerProxy};
|
||||
use alacritty::sync::FairMutex;
|
||||
use alacritty::term::Term;
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
use bitflags::bitflags;
|
||||
|
||||
use crate::ansi::{NamedColor, Color};
|
||||
use crate::grid;
|
||||
use crate::index::Column;
|
||||
|
|
|
@ -499,6 +499,8 @@ impl<'a> Iterator for RenderableCellsIter<'a> {
|
|||
}
|
||||
|
||||
pub mod mode {
|
||||
use bitflags::bitflags;
|
||||
|
||||
bitflags! {
|
||||
pub struct TermMode: u16 {
|
||||
const SHOW_CURSOR = 0b00_0000_0000_0001;
|
||||
|
|
Loading…
Reference in a new issue