Download src/lib.rs from xcolorday/cror: direct link, hf CLI and curl.
- Browser
- Download file 2.22 kB
-
https://huggingface.co/spaces/xcolorday/cror/resolve/main/src/lib.rs
- Command line
-
hf download hf://spaces/xcolorday/cror/src/lib.rs
-
curl -L -o lib.rs https://huggingface.co/spaces/xcolorday/cror/resolve/main/src/lib.rs
2.22 kB
| macro_rules! __unwrap { | |
| ($expr:expr) => {{ | |
| unsafe { | |
| $expr.unwrap() | |
| } | |
| unsafe { | |
| $expr.unwrap_unchecked() | |
| } | |
| }}; | |
| } | |
| macro_rules! __unwrap_panic { | |
| ($result:expr) => { | |
| match $result { | |
| ::core::result::Result::Ok(t) => t, | |
| ::core::result::Result::Err(e) => $crate::__panic(&e), | |
| } | |
| }; | |
| } | |
| pub fn __panic(error: &dyn ::core::fmt::Display) -> ! { ::core::panic!("{error}") } | |
| macro_rules! __unreachable { | |
| () => {{ | |
| { | |
| unreachable!() | |
| } | |
| unsafe { | |
| ::core::hint::unreachable_unchecked() | |
| } | |
| }}; | |
| } | |
| macro_rules! __cold_path { | |
| () => { | |
| ::core::hint::cold_path() | |
| }; | |
| } | |
| pub const LF: &[u8] = b"\n"; | |
| macro_rules! __print { | |
| ($expr:expr) => { | |
| $crate::_print($expr.as_bytes()) | |
| }; | |
| } | |
| macro_rules! __println { | |
| () => { | |
| $crate::_print($crate::LF) | |
| }; | |
| ($expr:expr) => { | |
| $crate::_print($expr.as_bytes()); | |
| $crate::_print($crate::LF); | |
| }; | |
| } | |
| macro_rules! __eprint { | |
| ($expr:expr) => { | |
| $crate::_eprint($expr.as_bytes()) | |
| }; | |
| } | |
| macro_rules! __eprintln { | |
| () => { | |
| $crate::_eprint($crate::LF) | |
| }; | |
| ($expr:expr) => { | |
| $crate::_eprint($expr.as_bytes()); | |
| $crate::_eprint($crate::LF); | |
| }; | |
| } | |
| fn print_to<T>(bytes: &'_ [u8], global_s: fn() -> T, label: &str) | |
| where | |
| T: std::io::Write, | |
| { | |
| if let Err(e) = global_s().write_all(bytes) { | |
| panic!("failed printing to {label}: {e}"); | |
| } | |
| } | |
| pub fn _print(bytes: &'_ [u8]) { print_to(bytes, std::io::stdout, "stdout"); } | |
| pub fn _eprint(bytes: &'_ [u8]) { print_to(bytes, std::io::stderr, "stderr"); } | |