Skip to content

Commit

Permalink
Merge #620
Browse files Browse the repository at this point in the history
620: Tidy up r=justahero a=Urhengulas

* decoder: Drop unused leb128 dependency
* defmt: Drop unused fn zigzag_encode
* decoder: Drop barely used dependency ansi_term
* Drop old defmt-* features 
* `defmt`: Drop `mod leb` (it is not used anymore) 

Co-authored-by: Johann Hemmann <johann.hemmann@code.berlin>
  • Loading branch information
bors[bot] and Urhengulas authored Oct 27, 2021
2 parents add2203 + eedbb6c commit 3b69ac2
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 150 deletions.
2 changes: 0 additions & 2 deletions decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ version = "0.2.2"
defmt-parser = { path = "../parser", features = ["unstable"], version = "=0.2.2" }
byteorder = "1"
colored = "2.0"
leb128 = "0.2"
ryu = "1"

# logger
ansi_term = "0.12"
difference = "2.0"
log = { version = "0.4", features = ["std"] }

Expand Down
8 changes: 2 additions & 6 deletions decoder/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! [`defmt`]: https://crates.io/crates/defmt

use crate::Frame;
use ansi_term::Colour;
use colored::{Color, Colorize};
use difference::{Changeset, Difference};
use log::{Level, Log, Metadata, Record};
Expand Down Expand Up @@ -204,9 +203,6 @@ fn color_diff(text: String) -> String {
&& right.starts_with(RIGHT_START)
&& right.ends_with(END)
{
const DARK_RED: Colour = Colour::Fixed(52);
const DARK_GREEN: Colour = Colour::Fixed(22);

// `defmt::assert_eq!` output
let left = &left[LEFT_START.len()..left.len() - END.len()];
let right = &right[RIGHT_START.len()..right.len() - END.len()];
Expand All @@ -232,7 +228,7 @@ fn color_diff(text: String) -> String {
}
Difference::Add(_) => continue,
Difference::Rem(s) => {
write!(buf, "{}", Colour::Red.on(DARK_RED).bold().paint(s)).ok();
write!(buf, "{}", s.red().bold()).ok();
}
}
}
Expand All @@ -246,7 +242,7 @@ fn color_diff(text: String) -> String {
}
Difference::Rem(_) => continue,
Difference::Add(s) => {
write!(buf, "{}", Colour::Green.on(DARK_GREEN).bold().paint(s)).ok();
write!(buf, "{}", s.green().bold()).ok();
}
}
}
Expand Down
126 changes: 0 additions & 126 deletions defmt/src/leb.rs

This file was deleted.

9 changes: 0 additions & 9 deletions firmware/defmt-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@ cortex-m = "0.7.2"
cortex-m-rt = "0.7.0"
defmt = { version = "0.2.2", path = "../../defmt" }
defmt-test-macros = { version = "=0.2.1", path = "macros" }

[features]
defmt-default = []
defmt-trace = []
defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []
default = ["defmt-trace"] # enable everything
7 changes: 0 additions & 7 deletions firmware/qemu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ alloc-cortex-m = { version = "0.4.1", optional = true }
linked_list_allocator = { version = "0.9.0", optional = true }

[features]
defmt-default = [] # log at INFO, or TRACE, level and up
defmt-trace = [] # log at TRACE level and up
defmt-debug = [] # log at DEBUG level and up
defmt-info = [] # log at INFO level and up
defmt-warn = [] # log at WARN level and up
defmt-error = [] # log at ERROR level
default = ["defmt-default"]
alloc = ["defmt/alloc", "alloc-cortex-m", "linked_list_allocator/const_mut_refs"]

[[bin]]
Expand Down

0 comments on commit 3b69ac2

Please sign in to comment.