Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit d62dd29

Browse files
author
Alex Helfet
committed
Remove heapless patch, use its Debug implementation.
1 parent 4d8196e commit d62dd29

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ chrono = "^0.4"
1414
clap = "^2.14.0"
1515
env_logger = "^0.4.3"
1616
error-chain = "^0.11.0"
17-
heapless = "^0.2.0"
17+
heapless = "^0.2.1"
1818
libc = "^0.2.17"
1919
log = "^0.3.8"
2020
ref_slice = "^1.1.0"
2121

2222
[dev-dependencies]
2323
tempdir = "0.3.5"
24-
25-
# Patch `heapless` with my fork until my [PR] is merged.
26-
# Adds methods Vec::resize() and Vec::resize_default()
27-
# [PR] https://github.com/japaric/heapless/pull/13
28-
[patch.crates-io.heapless]
29-
git = "https://github.com/fluffysquirrels/heapless"
30-
rev = "0917beb92a92d06f6267ee595a65cb0858f3ed59"

src/packet.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Defines ITM packets and their possible contents.
22
33
use heapless::Vec as HVec;
4-
use std::fmt::{self, Debug, Formatter};
54

65
pub const MAX_PAYLOAD_SIZE: usize = 4;
76

@@ -40,6 +39,7 @@ pub enum Kind {
4039
}
4140

4241
/// Contents of an Instrumentation packet, with data from a software application
42+
#[derive(Debug)]
4343
pub struct Instrumentation {
4444
/// Data in this packet.
4545
pub(crate) payload: HVec<u8, [u8; MAX_PAYLOAD_SIZE]>,
@@ -59,15 +59,3 @@ impl Instrumentation {
5959
self.port
6060
}
6161
}
62-
63-
impl Debug for Instrumentation {
64-
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
65-
// TODO: impl Debug for heapless::Vec, then this can just be derived.
66-
// Eq, PartialEq, Clone would be good too.
67-
68-
f.debug_struct("Instrumentation")
69-
.field("payload", &&*self.payload)
70-
.field("port", &self.port)
71-
.finish()
72-
}
73-
}

0 commit comments

Comments
 (0)