schemaui 0.12.2

A Rust library for generating TUI and Web UIs from JSON Schemas for configuration management.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::collections::HashSet;

pub(crate) fn validate_unique_ids<I, S>(ids: I) -> Result<(), String>
where
    I: IntoIterator<Item = S>,
    S: AsRef<str>,
{
    let mut seen = HashSet::new();
    for id in ids {
        let id = id.as_ref();
        if !seen.insert(id.to_owned()) {
            return Err(format!("duplicate keymap entry id {id}"));
        }
    }
    Ok(())
}