Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: run mdbook tests #109

Merged
merged 7 commits into from
Aug 13, 2020
Merged

CI: run mdbook tests #109

merged 7 commits into from
Aug 13, 2020

Conversation

jonas-schievink
Copy link
Contributor

Revival of #62

fn format(&self, f: &mut Formatter) {
binfmt::write!(f, "{:u8}", self)
fn format(&self, f: &mut binfmt::Formatter) {
binfmt::export::write!(f, "{:u8}", self)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be removed, but I don't really know what to put there instead, since it's all private

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is part of the implementation notes so we can just say that these APIs are implementation details and shouldn't be used from libraries / applications.
or we instead of an impl in a rust code block we can use a text block that says this is how a u8's Format's implementation looks on the wire: showing only the array of bytes [1, the_u8_value]

``` rust
binfmt::error!("Hello, {:str}!", [b'w', b'o', b'r', b'l', b'd']);
<!-- TODO remove ',ignore' -->
``` rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work / pass now I think

@@ -2,14 +2,20 @@

To implement the `Format` trait for a struct or enum use the `derive` attribute.

``` rust
<!-- TODO remove ',ignore' -->
``` rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work / pass now I think

book/src/istr.md Outdated
@@ -5,21 +5,25 @@ Compared to the `{:str}` parameter, which transmits a complete string, `{:istr}`
The `{:istr}` parameter expects an argument with type `binfmt::Str`.
A `Str` value is created using the `intern!` macro; the argument to this macro must be a string literal.

``` rust
<!-- TODO remove ',ignore' -->
``` rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work / pass now I think

@@ -2,7 +2,9 @@

For arrays (`{:[u8; N]}`) the length is not serialized.

``` rust
<!-- TODO remove ',ignore' -->
``` rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work / pass now I think

@@ -3,7 +3,9 @@
Integers will be serialized in little endian order using `to_le_bytes()`.
`usize` and `isize` values will be subject to LEB128 compression.

``` rust
<!-- TODO remove ',ignore' -->
``` rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work / pass now I think

@japaric japaric merged commit e8184de into main Aug 13, 2020
@jonas-schievink jonas-schievink deleted the book-test branch August 13, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants