|
1 |
| -use std::collections::HashMap; |
| 1 | +use std::collections::BTreeMap; |
2 | 2 | use std::fs;
|
3 | 3 | use std::path::Path;
|
4 | 4 |
|
@@ -34,8 +34,8 @@ pub fn update_vendor(path: &Path, dir: &str, v: &VendorConfiguration) -> Result<
|
34 | 34 | Ok(())
|
35 | 35 | }
|
36 | 36 |
|
37 |
| -pub fn get_vendors(path: &Path) -> Result<HashMap<String, VendorConfiguration>> { |
38 |
| - let mut out = HashMap::new(); |
| 37 | +pub fn get_vendors(path: &Path) -> Result<BTreeMap<String, VendorConfiguration>> { |
| 38 | + let mut out = BTreeMap::new(); |
39 | 39 | let vendors = fs::read_dir(path.join("vendors"))?;
|
40 | 40 | for vendor in vendors {
|
41 | 41 | let vendor = vendor?.path();
|
@@ -106,8 +106,8 @@ pub fn update_codec(
|
106 | 106 | pub fn get_codecs(
|
107 | 107 | path: &Path,
|
108 | 108 | vendor_dir: &str,
|
109 |
| -) -> Result<HashMap<String, (String, String, String)>> { |
110 |
| - let mut out = HashMap::new(); |
| 109 | +) -> Result<BTreeMap<String, (String, String, String)>> { |
| 110 | + let mut out = BTreeMap::new(); |
111 | 111 | let codecs_path = path.join("vendors").join(vendor_dir).join("codecs");
|
112 | 112 | let codecs = fs::read_dir(&codecs_path)?;
|
113 | 113 |
|
@@ -182,8 +182,8 @@ pub fn update_profile(
|
182 | 182 | pub fn get_profiles(
|
183 | 183 | path: &Path,
|
184 | 184 | vendor_dir: &str,
|
185 |
| -) -> Result<HashMap<String, ProfileConfiguration>> { |
186 |
| - let mut out = HashMap::new(); |
| 185 | +) -> Result<BTreeMap<String, ProfileConfiguration>> { |
| 186 | + let mut out = BTreeMap::new(); |
187 | 187 | let profiles = fs::read_dir(path.join("vendors").join(vendor_dir).join("profiles"))?;
|
188 | 188 | for profile in profiles {
|
189 | 189 | let profile = profile?.path();
|
@@ -246,8 +246,8 @@ pub fn update_device(
|
246 | 246 | create_device(path, vendor_dir, name, device)
|
247 | 247 | }
|
248 | 248 |
|
249 |
| -pub fn get_devices(path: &Path, vendor_dir: &str) -> Result<HashMap<String, DeviceConfiguration>> { |
250 |
| - let mut out = HashMap::new(); |
| 249 | +pub fn get_devices(path: &Path, vendor_dir: &str) -> Result<BTreeMap<String, DeviceConfiguration>> { |
| 250 | + let mut out = BTreeMap::new(); |
251 | 251 | let devices = fs::read_dir(path.join("vendors").join(vendor_dir).join("devices"))?;
|
252 | 252 | for device in devices {
|
253 | 253 | let device = device?.path();
|
|
0 commit comments