Skip to content

Commit

Permalink
Merge pull request #263 from quartiq/release-v0.17.2
Browse files Browse the repository at this point in the history
release v0.17.2
  • Loading branch information
jordens authored Nov 19, 2024
2 parents 0911404 + 43fac62 commit 15fea09
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
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 <irwineffect@gmail.com>",
"Ryan Summers <ryan.summers@vertigo-designs.com>",
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 <irwineffect@gmail.com>", "Ryan Summers <ryan.summers@vertigo-designs.com>", "Robert Jördens <rj@quartiq.de>"]
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 = "ryan.summers@vertigo-designs.com" },
Expand Down

0 comments on commit 15fea09

Please sign in to comment.