coco/lib.rs
1use rust_i18n::i18n;
2i18n!();
3
4pub use rust_i18n::t;
5pub mod core;
6pub mod tui;
7
8/// create string
9///
10/// create a new `String` from a string literal.
11#[macro_export]
12macro_rules! s {
13 ($s:expr) => {
14 String::from($s)
15 };
16}
17
18/// fail macro
19///
20/// same as `bail!` but without the explicit return
21#[macro_export]
22macro_rules! fail {
23 ($msg:literal $(,)?) => {
24 Err(eyre::eyre!($msg))
25 };
26 ($err:expr $(,)?) => {
27 Err(eyre::eyre!($err))
28 };
29 ($fmt:expr, $($arg:tt)*) => {
30 Err(eyre::eyre!($fmt, $($arg)*))
31 };
32}