gobby-code 0.9.0

Fast Rust CLI for Gobby's code index — AST-aware search, symbol navigation, and dependency graph
Documentation
pub fn short_id(id: &str) -> &str {
    id.get(..8).unwrap_or(id)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn short_id_truncates_long_ids() {
        assert_eq!(short_id("1234567890"), "12345678");
    }

    #[test]
    fn short_id_returns_input_for_short_strings() {
        assert_eq!(short_id("abc"), "abc");
    }

    #[test]
    fn short_id_returns_input_for_exact_length() {
        assert_eq!(short_id("12345678"), "12345678");
    }
}