Skip to content

Commit

Permalink
Update Bluetooth numbers database
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Oct 21, 2021
1 parent ec12c48 commit 54955ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bluer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fn convert_uuids(src: &str, dest: &str, name: &str, doc_name: &str, prefix: &str
writeln!(out, "impl TryFrom<Uuid> for {} {{", name)?;
writeln!(out, " type Error = Uuid;")?;
writeln!(out, " fn try_from(uuid: Uuid) -> Result<Self, Uuid> {{")?;
writeln!(out, " #[allow(unreachable_patterns)]")?;
writeln!(out, " match uuid.as_u128() {{")?;
for entry in entries {
writeln!(out, " {} => Ok(Self::{}),", entry.uuid()?.as_u128(), entry.rust_id(prefix))?;
Expand Down Expand Up @@ -189,6 +190,7 @@ fn convert_ids(src: &str, dest: &str, name: &str, doc_name: &str) -> Result<(),
writeln!(out, "impl TryFrom<u16> for {} {{", name)?;
writeln!(out, " type Error = u16;")?;
writeln!(out, " fn try_from(code: u16) -> Result<Self, u16> {{")?;
writeln!(out, " #[allow(unreachable_patterns)]")?;
writeln!(out, " match code {{")?;
for entry in entries {
writeln!(out, " {} => Ok(Self::{}),", entry.code, entry.rust_id())?;
Expand Down

0 comments on commit 54955ca

Please sign in to comment.