Skip to content

Commit

Permalink
Merge branch 'master' into eliza/typos
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw authored Apr 16, 2024
2 parents 5ace275 + 20e6160 commit 969a74a
Show file tree
Hide file tree
Showing 87 changed files with 5,472 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name = "humility"
#
# Be sure to check in and push all of the files that change. Happy versioning!
#
version = "0.11.3"
version = "0.11.4"
authors = ["Bryan Cantrill <bryan@oxide.computer>"]
edition = "2018"
license = "MPL-2.0"
Expand Down
27 changes: 26 additions & 1 deletion humility-doppel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,35 @@ impl humility::reflect::Load for TaskId {
pub struct RingbufEntry {
pub line: u16,
pub generation: u16,
pub count: u32,
pub count: RingbufCount,
pub payload: Value,
}

#[derive(Clone, Debug)]
pub struct RingbufCount(Option<u64>);

impl humility::reflect::Load for RingbufCount {
fn from_value(v: &Value) -> Result<Self> {
match v.as_base()? {
Base::U0 => Ok(Self(None)),
Base::U8(v) => Ok(Self(Some(u64::from(*v)))),
Base::U16(v) => Ok(Self(Some(u64::from(*v)))),
Base::U32(v) => Ok(Self(Some(u64::from(*v)))),
Base::U64(v) => Ok(Self(Some(*v))),
_ => bail!("not an unsigned integer: {v:?}"),
}
}
}

impl std::fmt::Display for RingbufCount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self.0 {
Some(v) => v.fmt(f),
None => "()".fmt(f),
}
}
}

/// Double of the struct from `ringbuf`.
///
/// The Hubris equivalent has a type parameter. We're dynamic instead; see
Expand Down
4 changes: 2 additions & 2 deletions tests/cmd/chip.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more information try --help

```
$ humility --chip this-can-be-anything -V
humility 0.11.3
humility 0.11.4

```

Expand All @@ -28,7 +28,7 @@ For more information try --help

```
$ humility -c apx432 -V
humility 0.11.3
humility 0.11.4

```

Binary file added tests/cmd/cores/hubris.core.u16-ringbuf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/cmd/counters-arg/counters-arg.u16-ringbuf.stderr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions tests/cmd/counters-arg/counters-arg.u16-ringbuf.stdout

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions tests/cmd/counters-arg/counters-arg.u16-ringbuf.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

492 changes: 492 additions & 0 deletions tests/cmd/counters-csv-full/counters-csv-full.u16-ringbuf.stdout

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tests/cmd/counters-csv-full/counters-csv-full.u16-ringbuf.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/cmd/counters-csv/counters-csv.u16-ringbuf.stderr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions tests/cmd/counters-csv/counters-csv.u16-ringbuf.stdout

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions tests/cmd/counters-csv/counters-csv.u16-ringbuf.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/cmd/counters-full/counters-full.u16-ringbuf.stderr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 969a74a

Please sign in to comment.