Skip to content

Commit

Permalink
Fixing doctests
Browse files Browse the repository at this point in the history
The derive feature was still being activated by a dependency in the
benchmarks crate, which allowed the doctests in the pot crate to
function when part of a larger build command.

I've updated the CI workflow to make sure that pot is now tested
independently of the full workspace.
  • Loading branch information
ecton committed Aug 24, 2023
1 parent 7b753e1 commit a1592aa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
run: |
cargo clippy
- name: Run unit tests
- name: Run unit tests (Pot)
run: |
cargo test -p pot
- name: Run unit tests (Workspace)
run: |
cargo test --all-features
2 changes: 1 addition & 1 deletion .rustme/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provide an encoding format for [`serde`](https://serde.rs) that:
* Is compact. While still being self-describing, Pot's main space-saving feature
is not repeating symbols/identifiers more than one time while serializing.
When serializing arrays of structures, this can make a major difference. The
[logs.rs](https://github.com/khonsulabs/pot/blob/main/pot/examples/logs.rs)
[logs.rs](https://github.com/khonsulabs/pot/blob/main/benchmarks/examples/logs.rs)
example demonstrates this:

```sh
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ our only requirements for contributing:
- All contributors must uphold the standards of our [Code of
Conduct](./CODE_OF_CONDUCT.md).

The rest of this document are recommendations/guidelines to help consistency and
The rest of this document is recommendations/guidelines to help consistency and
communication within our projects.

## Creating Issues
Expand Down Expand Up @@ -45,7 +45,7 @@ working on it. This will help prevent duplicated efforts.

If you begin working on something but need some assistance, don't hesitate to
reach out inside of the issue, on [our
forums](https://community.khonsulabs.com/), or [our
forums](https://community.khonsulabs.com/), or in [our
Discord](https://discord.khonsulabs.com/). We will do our best to help you.

### Project-specific requirements
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ provide an encoding format for [`serde`](https://serde.rs) that:
## Example

```rust
use serde::{Deserialize, Serialize};
use serde_derive::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct User {
id: u64,
Expand Down Expand Up @@ -102,8 +101,8 @@ is only aimed at comparing the default performance for each library.
## Open-source Licenses
This project, like all projects from [Khonsu Labs](https://khonsulabs.com/), are
open-source. This repository is available under the [MIT License](./LICENSE-MIT)
or the [Apache License 2.0](./LICENSE-APACHE).
This project, like all projects from [Khonsu Labs](https://khonsulabs.com/), is open-source.
This repository is available under the [MIT License](./LICENSE-MIT) or the
[Apache License 2.0](./LICENSE-APACHE).
To learn more about contributing, please see [CONTRIBUTING.md](./CONTRIBUTING.md).
5 changes: 2 additions & 3 deletions pot/crate-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provide an encoding format for [`serde`](https://serde.rs) that:
* Is compact. While still being self-describing, Pot's main space-saving feature
is not repeating symbols/identifiers more than one time while serializing.
When serializing arrays of structures, this can make a major difference. The
[logs.rs](https://github.com/khonsulabs/pot/blob/main/pot/examples/logs.rs)
[logs.rs](https://github.com/khonsulabs/pot/blob/main/benchmarks/examples/logs.rs)
example demonstrates this:

```sh
Expand All @@ -40,8 +40,7 @@ provide an encoding format for [`serde`](https://serde.rs) that:
## Example

```rust
use serde::{Deserialize, Serialize};
use serde_derive::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct User {
id: u64,
Expand Down
4 changes: 2 additions & 2 deletions pot/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<'a> Value<'a> {
/// ```rust
/// # fn test() -> Result<(), pot::ValueError> {
/// use pot::Value;
/// use serde::Serialize;
/// use serde_derive::Serialize;
///
/// #[derive(Serialize, Debug)]
/// enum Example {
Expand Down Expand Up @@ -72,7 +72,7 @@ impl<'a> Value<'a> {
/// ```rust
/// # fn test() -> Result<(), pot::ValueError> {
/// use pot::Value;
/// use serde::{Deserialize, Serialize};
/// use serde_derive::{Deserialize, Serialize};
///
/// #[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
/// enum Example {
Expand Down

0 comments on commit a1592aa

Please sign in to comment.