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

release v0.17.2 #263

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/quartiq/miniconf/compare/v0.17.1...HEAD) - DATE
## [0.17.2](https://github.com/quartiq/miniconf/compare/v0.17.1...v0.17.2) - 2024-11-19

### Added

Expand Down
4 changes: 2 additions & 2 deletions miniconf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "miniconf"
# Sync all crate versions and the py client
version = "0.17.1"
version = "0.17.2"
authors = [
"James Irwin <[email protected]>",
"Ryan Summers <[email protected]>",
Expand All @@ -16,7 +16,7 @@ categories = ["embedded", "config", "data-structures", "parsing"]

[dependencies]
serde = { version = "1.0.120", default-features = false }
miniconf_derive = { path = "../miniconf_derive", version = "0.17.0", optional = true }
miniconf_derive = { path = "../miniconf_derive", version = "0.17.2", optional = true }
itoa = "1.0.4"
serde-json-core = { version = "0.6.0", optional = true }
postcard = { version = "1.0.8", optional = true }
Expand Down
21 changes: 20 additions & 1 deletion miniconf/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ impl<T: Iterator> Iterator for ExactSize<T> {
}
}

impl<T> ExactSize<T> {
/// Return a reference to the inner iterator
#[inline]
pub fn inner(&self) -> &T {
&self.iter
}
}

// Even though general TreeKey iterations may well be longer than usize::MAX
// we are sure that the aren't in this case since self.count <= usize::MAX
impl<T: Iterator> ExactSizeIterator for ExactSize<T> {}
Expand All @@ -52,6 +60,7 @@ impl<T: Keys> Keys for Consume<T> {
Ok(())
}
}

impl<T: Keys> IntoKeys for Consume<T> {
type IntoKeys = Self;

Expand Down Expand Up @@ -127,6 +136,16 @@ impl<M: TreeKey + ?Sized, N, const D: usize> NodeIter<M, N, D> {
count: meta.count,
}
}

/// Return the current iteration depth
pub fn current_depth(&self) -> usize {
self.depth
}

/// Return the root depth
pub fn root_depth(&self) -> usize {
self.root
}
}

impl<M, N, const D: usize> Iterator for NodeIter<M, N, D>
Expand Down Expand Up @@ -173,7 +192,7 @@ where
}
}

// Do not allow manipulation of `depth` other than through iteration.
// Contract: Do not allow manipulation of `depth` other than through iteration.
impl<M: TreeKey + ?Sized, N: Transcode + Default, const D: usize> core::iter::FusedIterator
for NodeIter<M, N, D>
{
Expand Down
2 changes: 1 addition & 1 deletion miniconf_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "miniconf_derive"
version = "0.17.0"
version = "0.17.2"
authors = ["James Irwin <[email protected]>", "Ryan Summers <[email protected]>", "Robert Jördens <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion py/miniconf-mqtt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ text = "MIT"
[project]
name = "miniconf-mqtt"
# Note: keep this in sync with Cargo.toml
version = "0.17.0"
version = "0.17.2"
description = "Utilities for configuring Miniconf-configurable devices"
authors = [
{ name = "Ryan Summers", email = "[email protected]" },
Expand Down
Loading