Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/commands/status.rs @ 52300:04b9a56c2d25
rust-lib: only export very common types to the top of the crate
This was done very early in the Rust project's lifecycle and I had very little
Rust experience. Let's keep the `DirstateParents` since they'll pop up in
all higher-level code and make the rest more explicit imports to make the
imports less confusing and the lib less cluttered.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 04 Nov 2024 11:13:05 +0100 |
parents | b422acba55f1 |
children | 79e8118cd846 |
line wrap: on
line diff
--- a/rust/rhg/src/commands/status.rs Mon Nov 04 11:07:05 2024 +0100 +++ b/rust/rhg/src/commands/status.rs Mon Nov 04 11:13:05 2024 +0100 @@ -15,7 +15,9 @@ use format_bytes::format_bytes; use hg::config::Config; use hg::dirstate::entry::{has_exec_bit, TruncatedTimestamp}; -use hg::dirstate::status::StatusPath; +use hg::dirstate::status::{ + BadMatch, DirstateStatus, StatusError, StatusOptions, StatusPath +}; use hg::errors::{HgError, IoResultExt}; use hg::filepatterns::parse_pattern_args; use hg::lock::LockError; @@ -29,11 +31,8 @@ get_bytes_from_os_str, get_bytes_from_os_string, get_path_from_bytes, }; use hg::utils::hg_path::{hg_path_to_path_buf, HgPath}; -use hg::DirstateStatus; use hg::PatternFileWarning; use hg::Revision; -use hg::StatusError; -use hg::StatusOptions; use hg::{self, narrow, sparse}; use log::info; use rayon::prelude::*; @@ -355,10 +354,10 @@ for (path, error) in take(&mut ds_status.bad) { let error = match error { - hg::BadMatch::OsError(code) => { + BadMatch::OsError(code) => { std::io::Error::from_raw_os_error(code).to_string() } - hg::BadMatch::BadType(ty) => { + BadMatch::BadType(ty) => { format!("unsupported file type (type is {})", ty) } };