Skip to content

Commit

Permalink
fix nightly fmt import ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessizeland committed Oct 31, 2024
1 parent 17470a9 commit 627c93c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
4 changes: 3 additions & 1 deletion update_uuids/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ mod utils;
mod writer;
mod yaml;

use std::error::Error;
use std::path::Path;

use git2::Repository;
use std::{error::Error, path::Path};

fn main() -> Result<(), Box<dyn Error>> {
// Download the latest assigned numbers from the Bluetooth SIG
Expand Down
19 changes: 8 additions & 11 deletions update_uuids/src/writer.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use crate::{
utils::screaming_snake_case,
yaml::{Category, UuidData},
};
use std::{
collections::HashMap,
error::Error,
fs::File,
io::Write,
path::{Path, PathBuf},
};
use std::collections::HashMap;
use std::error::Error;
use std::fs::File;
use std::io::Write;
use std::path::{Path, PathBuf};

use crate::utils::screaming_snake_case;
use crate::yaml::{Category, UuidData};

/// Update the UUIDs in the source code
pub fn update_uuids(output_folder: &Path, mut uuid_map: HashMap<String, Vec<UuidData>>) -> Result<(), Box<dyn Error>> {
Expand Down
12 changes: 5 additions & 7 deletions update_uuids/src/yaml.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::{
collections::HashMap,
error::Error,
path::{Path, PathBuf},
};
use std::collections::HashMap;
use std::error::Error;
use std::path::{Path, PathBuf};

use serde::Deserialize;
use walkdir::WalkDir;
Expand All @@ -20,7 +18,7 @@ struct Uuids {
uuids: Vec<UuidData>,
}

/// Load UUID data from a directory of YAML files,
/// Load UUID data from a directory of YAML files.
/// matches files in the bluetooth-sig/assigned_numbers/uuids folder.
pub fn load_uuid_data(path: &PathBuf) -> Result<HashMap<String, Vec<UuidData>>, Box<dyn Error>> {
let mut map = HashMap::new();
Expand All @@ -46,7 +44,7 @@ struct AppearanceValues {
pub struct Category {
pub category: u8,
pub name: String,
pub subcategory: Option<Vec<Subcategory>>
pub subcategory: Option<Vec<Subcategory>>,
}

#[derive(Debug, Deserialize)]
Expand Down

0 comments on commit 627c93c

Please sign in to comment.