changeset 44688:1f5ab1a9363d

rust-chg: upgrade to 2018 edition and remove useless extern crates Differential Revision: https://phab.mercurial-scm.org/D8399
author Yuya Nishihara <yuya@tcha.org>
date Fri, 10 Apr 2020 21:35:16 +0900
parents 1b8fd4af3318
children 6bef9d43cc55
files rust/chg/Cargo.toml rust/chg/build.rs rust/chg/src/attachio.rs rust/chg/src/lib.rs rust/chg/src/locator.rs rust/chg/src/main.rs
diffstat 6 files changed, 3 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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 <yuya@tcha.org>"]
 description = "Client for Mercurial command server with cHg extension"
 license = "GPL-2.0+"
+edition = "2018"
 
 [dependencies]
 bytes = "0.4"
--- 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)
--- 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;
--- 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;
--- 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};
--- 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};