caldir-core 0.14.1

Core library for caldir calendar storage, sync, and provider protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const MAX_SLUG_LENGTH: usize = 50;

pub fn slugify(s: &str) -> String {
    let slug = slug::slugify(s);
    slug.chars().take(MAX_SLUG_LENGTH).collect()
}

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

    #[test]
    fn slugifies_string() {
        assert_eq!(slugify("Meeting with Alice"), "meeting-with-alice");
    }
}