# HG changeset patch # User Yuya Nishihara # Date 2020-04-10 12:38:08 # Node ID 6bef9d43cc55b1beee8245dd34fab973022de8b7 # Parent 1f5ab1a9363d8aed045b238ce6fed9de2c3d0145 rust-chg: use "crate::" to import local modules I feel it's easier to follow to resolve modules from the crate root than relative path from self module. Differential Revision: https://phab.mercurial-scm.org/D8400 diff --git a/rust/chg/src/attachio.rs b/rust/chg/src/attachio.rs --- a/rust/chg/src/attachio.rs +++ b/rust/chg/src/attachio.rs @@ -12,8 +12,8 @@ use tokio_hglib::codec::ChannelMessage; use tokio_hglib::protocol::MessageLoop; use tokio_hglib::{Client, Connection}; -use super::message; -use super::procutil; +use crate::message; +use crate::procutil; /// Future to send client-side fds over the command server channel. /// diff --git a/rust/chg/src/clientext.rs b/rust/chg/src/clientext.rs --- a/rust/chg/src/clientext.rs +++ b/rust/chg/src/clientext.rs @@ -15,10 +15,10 @@ use std::path::Path; use tokio_hglib::protocol::{OneShotQuery, OneShotRequest}; use tokio_hglib::{Client, Connection}; -use super::attachio::AttachIo; -use super::message::{self, Instruction}; -use super::runcommand::ChgRunCommand; -use super::uihandler::SystemHandler; +use crate::attachio::AttachIo; +use crate::message::{self, Instruction}; +use crate::runcommand::ChgRunCommand; +use crate::uihandler::SystemHandler; pub trait ChgClientExt where diff --git a/rust/chg/src/locator.rs b/rust/chg/src/locator.rs --- a/rust/chg/src/locator.rs +++ b/rust/chg/src/locator.rs @@ -21,9 +21,9 @@ use tokio_hglib::UnixClient; use tokio_process::{Child, CommandExt}; use tokio_timer; -use super::clientext::ChgClientExt; -use super::message::{Instruction, ServerSpec}; -use super::procutil; +use crate::clientext::ChgClientExt; +use crate::message::{Instruction, ServerSpec}; +use crate::procutil; const REQUIRED_SERVER_CAPABILITIES: &[&str] = &[ "attachio", diff --git a/rust/chg/src/runcommand.rs b/rust/chg/src/runcommand.rs --- a/rust/chg/src/runcommand.rs +++ b/rust/chg/src/runcommand.rs @@ -15,9 +15,9 @@ use tokio_hglib::codec::ChannelMessage; use tokio_hglib::protocol::MessageLoop; use tokio_hglib::{Client, Connection}; -use super::attachio::AttachIo; -use super::message::{self, CommandType}; -use super::uihandler::SystemHandler; +use crate::attachio::AttachIo; +use crate::message::{self, CommandType}; +use crate::uihandler::SystemHandler; enum AsyncS { Ready(R), diff --git a/rust/chg/src/uihandler.rs b/rust/chg/src/uihandler.rs --- a/rust/chg/src/uihandler.rs +++ b/rust/chg/src/uihandler.rs @@ -12,8 +12,8 @@ use std::process::{Command, Stdio}; use tokio; use tokio_process::{ChildStdin, CommandExt}; -use super::message::CommandSpec; -use super::procutil; +use crate::message::CommandSpec; +use crate::procutil; /// Callback to process shell command requests received from server. pub trait SystemHandler: Sized {