diff options
author | pommicket <pommicket@gmail.com> | 2025-09-09 01:39:49 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-09 01:39:49 -0400 |
commit | ae09ca3edfed42519192e8070f34bb5d5ee7c2ec (patch) | |
tree | b82b21aaa8e5efad4856e6ee9421ebe2d1afbc7b /src | |
parent | 52b9cbbbf23854d959989fa0195e9dcf476e9102 (diff) |
Remove subkeys() in line with spec
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -734,28 +734,6 @@ impl Configuration { self.into_iter() } - /// Get the list of all “direct children” of `key` in this configuration. - /// - /// More specifically, this returns an iterator of all unique - /// (*n*+1)th components of keys in `self` whose first *n* components - /// are equal to `key` (where `key` has *n* components). - /// - /// (So if there were keys `sheep.age`, `sheep.colour`, and `sheep.age.unit`, - /// `subkeys("sheep")` would give an iterator yielding - /// `"age"` and `"colour"` in some order.) - /// - /// The order of items returned is arbitrary and may change - /// in future versions without notice. - pub fn subkeys(&self, key: &str) -> impl '_ + Iterator<Item = &str> { - let key_dot = format!("{key}."); - let start_idx = self.subkey_start_idx(key); - (start_idx..self.items.len()).map_while(move |i| { - let this_key = &self.items[i].0; - let suffix = this_key.strip_prefix(&key_dot)?; - Some(suffix.split_once('.').map_or(suffix, |(x, _)| x)) - }) - } - fn get_val(&self, key: &str) -> Option<&Value> { let idx = self.binary_search_for(key).ok()?; Some(&self.items[idx].1) |