1
0
Fork 0
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:
Christian Duerr 2018-12-10 17:28:25 +01:00
parent 7ec36f2626
commit c01a383d1a
No known key found for this signature in database
GPG key ID: 85CDAE3C164BA7B4
6 changed files with 18 additions and 21 deletions

View file

@ -12,7 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use ::log; 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::index::{Line, Column};
use crate::config::{Dimensions, Shell}; use crate::config::{Dimensions, Shell};
use crate::window::{DEFAULT_TITLE, DEFAULT_CLASS}; use crate::window::{DEFAULT_TITLE, DEFAULT_CLASS};

View file

@ -14,6 +14,8 @@
use std::ops::{Index, IndexMut}; use std::ops::{Index, IndexMut};
use std::slice; use std::slice;
use static_assertions::assert_eq_size;
use crate::index::Line; use crate::index::Line;
use super::Row; use super::Row;

View file

@ -17,11 +17,8 @@
#![cfg_attr(feature = "nightly", feature(core_intrinsics))] #![cfg_attr(feature = "nightly", feature(core_intrinsics))]
#![cfg_attr(all(test, feature = "bench"), feature(test))] #![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 log;
#[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_derive;
#[macro_use] extern crate static_assertions;
#[cfg(windows)] #[cfg(windows)]
extern crate mio_named_pipes; extern crate mio_named_pipes;
@ -40,7 +37,6 @@ extern crate objc;
#[macro_use] #[macro_use]
pub mod macros; pub mod macros;
pub mod ansi; pub mod ansi;
pub mod cli; pub mod cli;
pub mod config; pub mod config;

View file

@ -23,13 +23,13 @@
// See https://msdn.microsoft.com/en-us/library/4cc7ya5b.aspx for more details. // See https://msdn.microsoft.com/en-us/library/4cc7ya5b.aspx for more details.
#![windows_subsystem = "windows"] #![windows_subsystem = "windows"]
#[macro_use]
extern crate alacritty;
#[macro_use]
extern crate log;
#[cfg(target_os = "macos")] #[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::error::Error;
use std::sync::Arc; use std::sync::Arc;
@ -40,18 +40,12 @@ use std::env;
#[cfg(not(windows))] #[cfg(not(windows))]
use std::os::unix::io::AsRawFd; 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")] #[cfg(target_os = "macos")]
use alacritty::locale; 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::logging::{self, LoggerProxy};
use alacritty::sync::FairMutex; use alacritty::sync::FairMutex;
use alacritty::term::Term; use alacritty::term::Term;

View file

@ -11,6 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use bitflags::bitflags;
use crate::ansi::{NamedColor, Color}; use crate::ansi::{NamedColor, Color};
use crate::grid; use crate::grid;
use crate::index::Column; use crate::index::Column;

View file

@ -499,6 +499,8 @@ impl<'a> Iterator for RenderableCellsIter<'a> {
} }
pub mod mode { pub mod mode {
use bitflags::bitflags;
bitflags! { bitflags! {
pub struct TermMode: u16 { pub struct TermMode: u16 {
const SHOW_CURSOR = 0b00_0000_0000_0001; const SHOW_CURSOR = 0b00_0000_0000_0001;