spans always come from real file

This commit is contained in:
Lukas Wirth 2023-11-24 16:38:48 +01:00
parent 394d11b0fa
commit 30093a6d81
57 changed files with 1369 additions and 1224 deletions

View file

@ -15,6 +15,7 @@ pub mod thread;
pub mod anymap;
pub use always_assert::{always, never};
pub use itertools;
#[inline(always)]
pub fn is_ci() -> bool {
@ -40,6 +41,24 @@ Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.
);
}
pub trait TupleExt {
type Head;
type Tail;
fn head(self) -> Self::Head;
fn tail(self) -> Self::Tail;
}
impl<T, U> TupleExt for (T, U) {
type Head = T;
type Tail = U;
fn head(self) -> Self::Head {
self.0
}
fn tail(self) -> Self::Tail {
self.1
}
}
pub fn to_lower_snake_case(s: &str) -> String {
to_snake_case(s, char::to_lowercase)
}