From d60e65036a81cce57ac23a001c7038fa6fb2042a Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 2 Sep 2020 17:52:50 +0200 Subject: [PATCH] Prefix all package names with `defmt-` --- Cargo.toml | 2 +- common/Cargo.toml | 4 ++-- decoder/Cargo.toml | 4 ++-- decoder/src/lib.rs | 4 ++-- elf2table/Cargo.toml | 4 ++-- elf2table/src/lib.rs | 2 +- qemu-run/Cargo.toml | 4 ++-- qemu-run/src/main.rs | 7 ++++--- src/export.rs | 5 ++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68fb40df..63c539db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ version = "0.1.0" [dependencies] defmt-macros = { path = "macros" } -common = { path = "common" } +defmt-common = { path = "common" } [workspace] members = [ diff --git a/common/Cargo.toml b/common/Cargo.toml index 830bd294..be16a3ca 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -2,5 +2,5 @@ authors = ["The Knurling-rs developers"] edition = "2018" license = "MIT OR Apache-2.0" -name = "common" -version = "0.1.0" \ No newline at end of file +name = "defmt-common" +version = "0.1.0" diff --git a/decoder/Cargo.toml b/decoder/Cargo.toml index 6ffead14..31bc8215 100644 --- a/decoder/Cargo.toml +++ b/decoder/Cargo.toml @@ -2,13 +2,13 @@ authors = ["The Knurling-rs developers"] edition = "2018" license = "MIT OR Apache-2.0" -name = "decoder" +name = "defmt-decoder" version = "0.1.0" [dependencies] defmt-parser = { path = "../parser" } +defmt-common = { path = "../common" } byteorder = "1" colored = "2.0.0" -common = { path = "../common" } leb128 = "0.2.4" ryu = "1" diff --git a/decoder/src/lib.rs b/decoder/src/lib.rs index 87e2806f..52f820b1 100644 --- a/decoder/src/lib.rs +++ b/decoder/src/lib.rs @@ -15,7 +15,7 @@ use std::{ use byteorder::{ReadBytesExt, LE}; use colored::Colorize; -use common::Level; +use defmt_common::Level; use defmt_parser::{Fragment, Type}; include!(concat!(env!("OUT_DIR"), "/version.rs")); @@ -682,7 +682,7 @@ fn zigzag_decode(unsigned: u64) -> i64 { mod tests { use std::collections::BTreeMap; - use common::Level; + use defmt_common::Level; use super::{Frame, Table}; use crate::Arg; diff --git a/elf2table/Cargo.toml b/elf2table/Cargo.toml index bb9888c6..87866250 100644 --- a/elf2table/Cargo.toml +++ b/elf2table/Cargo.toml @@ -2,12 +2,12 @@ authors = ["The Knurling-rs developers"] edition = "2018" license = "MIT OR Apache-2.0" -name = "elf2table" +name = "defmt-elf2table" version = "0.1.0" [dependencies] anyhow = "1.0.32" -decoder = { path = "../decoder" } +defmt-decoder = { path = "../decoder" } gimli = "0.22.0" [dependencies.object] diff --git a/elf2table/src/lib.rs b/elf2table/src/lib.rs index 66734470..ea20f409 100644 --- a/elf2table/src/lib.rs +++ b/elf2table/src/lib.rs @@ -7,7 +7,7 @@ use std::{ }; use anyhow::{anyhow, bail, ensure}; -pub use decoder::Table; +pub use defmt_decoder::Table; use object::{Object, ObjectSection}; /// Parses an ELF file and returns the decoded `defmt` table diff --git a/qemu-run/Cargo.toml b/qemu-run/Cargo.toml index 7138669d..4518f5e9 100644 --- a/qemu-run/Cargo.toml +++ b/qemu-run/Cargo.toml @@ -8,5 +8,5 @@ version = "0.1.0" [dependencies] anyhow = "1.0.32" -decoder = { path = "../decoder" } -elf2table = { path = "../elf2table" } +defmt-decoder = { path = "../decoder" } +defmt-elf2table = { path = "../elf2table" } diff --git a/qemu-run/src/main.rs b/qemu-run/src/main.rs index b7f2bb84..900245cd 100644 --- a/qemu-run/src/main.rs +++ b/qemu-run/src/main.rs @@ -5,7 +5,7 @@ use std::{ }; use anyhow::{anyhow, bail}; -use decoder::Table; +use defmt_decoder::Table; use process::Child; fn main() -> Result<(), anyhow::Error> { @@ -25,7 +25,8 @@ fn notmain() -> Result, anyhow::Error> { let path = &args[0]; let bytes = fs::read(path)?; - let table = elf2table::parse(&bytes)?.ok_or_else(|| anyhow!("`.defmt` section not found"))?; + let table = + defmt_elf2table::parse(&bytes)?.ok_or_else(|| anyhow!("`.defmt` section not found"))?; let mut child = KillOnDrop( Command::new("qemu-system-arm") @@ -84,7 +85,7 @@ fn notmain() -> Result, anyhow::Error> { } fn decode(frames: &mut Vec, table: &Table) { - while let Ok((frame, consumed)) = decoder::decode(&frames, &table) { + while let Ok((frame, consumed)) = defmt_decoder::decode(&frames, &table) { println!("{}", frame.display(true)); let n = frames.len(); frames.rotate_left(consumed); diff --git a/src/export.rs b/src/export.rs index affb1a24..881733f2 100644 --- a/src/export.rs +++ b/src/export.rs @@ -1,7 +1,7 @@ use crate::{Formatter, Str}; +pub use defmt_common::Level; pub use defmt_macros::write; -pub use common::Level; #[cfg(target_arch = "x86_64")] thread_local! { @@ -124,7 +124,6 @@ mod sealed { } } - impl Truncate for u64 { fn truncate(self) -> u16 { self as u16 @@ -154,4 +153,4 @@ mod sealed { pub fn truncate(x: impl sealed::Truncate) -> T { x.truncate() -} \ No newline at end of file +}