1 #![allow(clippy::single_component_path_imports)]
8 pub use self::fnv
::Key
;
10 pub(crate) use self::str_to_bool
::str_to_bool
;
11 pub(crate) use self::str_to_bool
::FALSE_LITERALS
;
12 pub(crate) use self::str_to_bool
::TRUE_LITERALS
;
13 pub(crate) use self::{graph::ChildGraph, id::Id}
;
17 pub(crate) const SUCCESS_CODE
: i32 = 0;
18 // While sysexists.h defines EX_USAGE as 64, this doesn't seem to be used much in practice but
19 // instead 2 seems to be frequently used.
21 // - GNU `ls` returns 2
22 // - Python's `argparse` returns 2
23 pub(crate) const USAGE_CODE
: i32 = 2;
25 pub(crate) fn safe_exit(code
: i32) -> ! {
28 let _
= std
::io
::stdout().lock().flush();
29 let _
= std
::io
::stderr().lock().flush();
31 std
::process
::exit(code
)
34 #[cfg(not(feature = "unicode"))]
35 pub(crate) fn eq_ignore_case(left
: &str, right
: &str) -> bool
{
36 left
.eq_ignore_ascii_case(right
)
39 #[cfg(feature = "unicode")]
40 pub(crate) use unicase
::eq
as eq_ignore_case
;