# HG changeset patch # User Yuya Nishihara # Date 1586522116 -32400 # Node ID 1f5ab1a9363d8aed045b238ce6fed9de2c3d0145 # Parent 1b8fd4af33189c84feadb47c74d659ec31cde3b9 rust-chg: upgrade to 2018 edition and remove useless extern crates Differential Revision: https://phab.mercurial-scm.org/D8399 diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/Cargo.toml --- a/rust/chg/Cargo.toml Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/Cargo.toml Fri Apr 10 21:35:16 2020 +0900 @@ -4,6 +4,7 @@ authors = ["Yuya Nishihara "] description = "Client for Mercurial command server with cHg extension" license = "GPL-2.0+" +edition = "2018" [dependencies] bytes = "0.4" diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/build.rs --- a/rust/chg/build.rs Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/build.rs Fri Apr 10 21:35:16 2020 +0900 @@ -1,5 +1,3 @@ -extern crate cc; - fn main() { cc::Build::new() .warnings(true) diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/src/attachio.rs --- a/rust/chg/src/attachio.rs Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/src/attachio.rs Fri Apr 10 21:35:16 2020 +0900 @@ -5,7 +5,7 @@ //! Functions to send client-side fds over the command server channel. -use futures::{Async, Future, Poll}; +use futures::{try_ready, Async, Future, Poll}; use std::io; use std::os::unix::io::AsRawFd; use tokio_hglib::codec::ChannelMessage; diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/src/lib.rs --- a/rust/chg/src/lib.rs Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/src/lib.rs Fri Apr 10 21:35:16 2020 +0900 @@ -3,17 +3,6 @@ // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. -extern crate bytes; -#[macro_use] -extern crate futures; -extern crate libc; -#[macro_use] -extern crate log; -extern crate tokio; -extern crate tokio_hglib; -extern crate tokio_process; -extern crate tokio_timer; - mod attachio; mod clientext; pub mod locator; diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/src/locator.rs --- a/rust/chg/src/locator.rs Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/src/locator.rs Fri Apr 10 21:35:16 2020 +0900 @@ -6,6 +6,7 @@ //! Utility for locating command-server process. use futures::future::{self, Either, Loop}; +use log::debug; use std::env; use std::ffi::{OsStr, OsString}; use std::fs::{self, DirBuilder}; diff -r 1b8fd4af3318 -r 1f5ab1a9363d rust/chg/src/main.rs --- a/rust/chg/src/main.rs Thu Apr 09 16:06:03 2020 +0530 +++ b/rust/chg/src/main.rs Fri Apr 10 21:35:16 2020 +0900 @@ -3,12 +3,6 @@ // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. -extern crate chg; -extern crate futures; -extern crate log; -extern crate tokio; -extern crate tokio_hglib; - use chg::locator::{self, Locator}; use chg::procutil; use chg::{ChgClientExt, ChgUiHandler};