PackageTrack
Sign in Get early access

konst

Const equivalents of std functions, compile-time comparison, and parsing

0.4.3 29M downloads/mo #1687 most downloaded on crates.io rodrimati1992/konst

What this package is like to depend on

Last release 4 months ago

16 Apr 2026

Release timing varies

gaps range from 8 days to 8 months

Most releases are documented

notes for 30 of 43 stable releases

3 versions withdrawn

withdrawn after publishing

5 years old

46 releases · first in 2021

4 releases in the last 12 months

see the full history below

Release timeline

46 releases · Mar 2021 to Apr 2026
2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 46
  1. 0.4.3 02 Nov 2025
    Release notes

    This release adds a destructure_rec macro for nested destructuring into maybe-Drop types and ArrayBuilder::{extend_from_array, extend_from_slice} methods.

    Changelog

    0.4.3

    Added "konst_proc_macros" feature

    Changed "parsing_proc" feature to also enable the "konst_proc_macros" feature.

    Added ArrayBuilder::{extend_from_array, extend_from_slice} methods

    Added destructure_rec macro (requires "konst_proc_macros" feature)

    Open source →
    Release notes

    Added "konst_proc_macros" feature

    Changed "parsing_proc" feature to also enable the "konst_proc_macros" feature.

    Added ArrayBuilder::{extend_from_array, extend_from_slice} methods

    Added destructure_rec macro (requires "konst_proc_macros" feature)

    Open source →
  2. 0.4.2 05 Sep 2025
    Release notes

    This release features the from_fn_nd and map_nd array macros for supporting non-local returns in const, and map_while, reduce,step_by iterator methods.

    Changelog

    0.4.2

    Added these methods to iterator macros:

    • map_while
    • reduce
    • step_by

    Fixed support of iterators of drop type in iterator macros. Previously drop items could only be produced by iterator methods, the input iterator could not be drop itself, now it can be.

    Changed implementations of "cmp"-feature-requiring methods in konst::iter::eval to support drop types.

    Added these macros in konst::array (these require the "iter" feature):

    • konst::array::from_fn_nd
    • konst::array::map_nd

    Added of_assumed_nondrop constructors to:

    • konst::array::ArrayBuilder
    • konst::array::IntoIter

    Added reexport of const_panic::unwrap_err in konst::result

    Open source →
    Release notes

    Added these methods to iterator macros:

    • map_while
    • reduce
    • step_by

    Fixed support of iterators of drop type in iterator macros. Previously drop items could only be produced by iterator methods, the input iterator could not be drop itself, now it can be.

    Changed implementations of "cmp"-feature-requiring methods in konst::iter::eval to support drop types.

    Added these macros in konst::array (these require the "iter" feature):

    • konst::array::from_fn_nd
    • konst::array::map_nd

    Added of_assumed_nondrop constructors to:

    • konst::array::ArrayBuilder
    • konst::array::IntoIter

    Added reexport of const_panic::unwrap_err in konst::result

    Open source →
  3. 0.4.1 17 Aug 2025

    Nothing published for this version

  4. 0.4.0 17 Aug 2025
    Release notes

    This release features:

    • the change from using methods that take and return Self by value to using &mut self for mutating methods (which unlocks being able to iterate over arrays by value!)
    • many "cmp"-feature-based methods in iterator macros
    • many new slice and Option const-equivalents of std methods

    among other changes.

    Changelog

    0.4.0

    0.4.0

    Removed these items because there is an equivalent built-in replacement:

    • konst::alloc_type::COW_STR_NEW: replaced by const { Cow::Borrowed("") }
    • konst::alloc_type::STRING_NEW: replaced by const { String::new() }
    • konst::alloc_type::VEC_NEW: replaced by const { Vec::new() }
    • konst::chr::from_u32_unchecked
    • konst::chr::from_u32
    • konst::ffi::cstr: CStr constructors are const, unwrappable with konst::result::unwrap
    • konst::konst macro: replaced by const { } blocks
    • konst::maybe_uninit::as_mut_ptr
    • konst::maybe_uninit::as_ptr
    • konst::maybe_uninit::assume_init_ref
    • konst::maybe_uninit::assume_init
    • konst::maybe_uninit::UNINIT: replaced by const { MaybeUninit::uninit() }
    • konst::option::copied
    • konst::option::flatten
    • konst::option::NONE: replaced by const { None }
    • konst::option::unwrap
    • konst::primitive::parse_i* functions: replaced by integer from_str_radix methods, unwrappable with konst::result::unwrap
    • konst::primitive::parse_u* functions: replaced by integer from_str_radix methods, unwrappable with konst::result::unwrap
    • konst::ptr::as_mut: replaced by &mut *pointer
    • konst::ptr::as_ref: replaced by &*pointer
    • konst::ptr::nonnull::as_mut
    • konst::ptr::nonnull::as_ref
    • konst::slice::as_chunks
    • konst::slice::as_rchunks
    • konst::slice::bytes_trim_end: replaced by <[u8]>::trim_ascii_end
    • konst::slice::bytes_trim_start: replaced by <[u8]>::trim_ascii_start
    • konst::slice::bytes_trim: replaced by <[u8]>::trim_ascii
    • konst::slice::first_mut
    • konst::slice::last_mut
    • konst::slice::split_first_mut
    • konst::slice::split_last_mut
    • konst::string::from_utf8
    • konst::string::is_char_boundary
    • string::trim_end: replaced by str::trim_ascii_end
    • string::trim_start: replaced by str::trim_ascii_start
    • string::trim: replaced by str::trim_ascii

    (the items in the list above without an explicit reason were replaced by a method or function of the same name)

    Removed these items because their unstable std equivalents were removed:

    • konst::slice::array_chunks
    • konst::slice::array_chunks_mut
    • konst::slice::ArrayChunks
    • konst::slice::ArrayChunksRev
    • konst::slice::ArrayChunksMut
    • konst::slice::ArrayChunksMutRev

    Removed these functions due to having an unsound impl:

    • konst::ptr::is_null
    • konst::ptr::nonnull::new

    Removed these items because they are not needed anymore:

    • konst::rebind_if_ok macro
    • konst::try_rebind macro
    • konst::polymorphism::type_eq_projection_fn macro: replaced by typewit::TypeFn+TypeEq::project
    • konst::unwrap_ctx macro: superceeded by konst::result::unwrap
    • panic methods: superceeded by const_panic::PanicFmt impls
    • konst::parsing::ParserResult: using the type it aliased instead of the alias
    • konst::parsing::ParseValueResult: using the type it aliased instead of the alias
    • konst::cmp::ConstCmpUnref: replaced by ConstCmp::This associated type

    Constrained macros that take closures from taking functions through :expr to :path, to keep the evaluation order of macros consistent with functions.

    Added these macros at the root module:

    • if_let_Some
    • while_let_Some

    Added konst::drop_flavor module with these items:

    • DropFlavor trait
    • DropFlavorWrapper trait
    • MayDrop marker type
    • NonDrop marker type
    • unwrap function
    • as_inner function
    • as_inner_mut function
    • wrap function

    Renameed konst::array::{map_, from_fn_} macros to map and from_fn respectively, replacing the old macros of the same name in the process.

    Changes to konst::array::ArrayConsumer:

    • renamed into IntoIter
    • impld ConstIntoIter for it
    • changed its next* methods to return Option<T> instead of Option<ManuallyDrop<T>> (to be consistent with ConstIntoIter API).
    • added D: DropFlavor parameter to konst::array::IntoIter to make it sometimes not need dropping
    • replaced new constructor with new of_copy and of_drop constructors.
    • added into_copy method
    • added into_drop method
    • added rev method

    Changes to konst::array::ArrayBuilder

    • added D: DropFlavor type parameter to make it sometimes not need dropping.
    • replaced new constructor with new of_copy and of_drop constructors.
    • added is_empty method
    • added into_copy method
    • added into_drop method

    Change: Made array items conditional on "iter" feature:

    • konst::array::ArrayBuilder
    • konst::array::from_fn
    • konst::array::IntoIter
    • konst::array::IntoIterRev
    • konst::array::map

    Added ConstIntoIter impl for arrays that uses konst::array::IntoIter<T, L, MayDrop> as the iterator.

    Added konst::array::IntoIterRev iterator.

    Added these items for ConstCmp overhaul;

    • konst::cmp::ConstCmp::This associated type
    • konst::cmp::ConstCmpKind trait
    • konst::cmp::CoerceTo type alias

    Removed IsRefKind reexport from konst::cmp and made it not a valid ConstCmp::Kind

    Merged all inherent coerce methods of IsAConstCmp into one generic method.

    Replaced CmpWrapper::slice constructor with from_ref, which takes any &T and converts it into &CmpWrapper<T>.

    Changed the precise type that std types are coerced into for having const_eq and const_cmp methods:

    • for arrays: instead of converting &[T; N] to CmpWrapper<&[T]>, it's converted to &CmpWrapper<[T; N]>
    • slices: instead of converting &[T] to CmpWrapper<&[T]>, it's converted to &<[T]>
    • strs: instead of converting &str to CmpWrapper<&str>, it's converted to &str
    • every other std type: instead of converting &T to CmpWrapper<T>, it's converted to &CmpWrapper<T>

    Moved these macros to konst::cmp module:

    • coerce_to_cmp
    • const_cmp
    • const_cmp_for
    • const_eq
    • const_eq_for
    • impl_cmp
    • max
    • max_by
    • max_by_key
    • min
    • min_by
    • min_by_key
    • try_equal

    Changed konst::cmp::{const_cmp_for, const_eq_for} to borrow their slice arguments

    Added these comparison macros:

    • konst::cmp::const_ge
    • konst::cmp::const_ge_for
    • konst::cmp::const_gt
    • konst::cmp::const_gt_for
    • konst::cmp::const_le
    • konst::cmp::const_le_for
    • konst::cmp::const_lt
    • konst::cmp::const_lt_for
    • konst::cmp::const_ne
    • konst::cmp::const_ne_for

    Fixed how const_cmp_for macro and const_cmp methods compared slices for ordering, they used to consider all slices less than all longer slices. Now const_cmp!(short_slice, longer_slice) only returns Less if all elements of short_slice are less than or equal to the longer_slice elements at the same index.

    Turned iterators from taking Self and returning Option<(Self::Item, Self)> into taking &mut Self and returning Option<Self::Item>.

    Removed support for lifetime promotion in return value of iterator methods in iterator macros, i.e.: there's no guarantee that the returned reference be usable in the following methods.

    Added konst::iter::ConstIntoIter::ITEMS_NEED_DROP associated constant

    Added konst::iter::ConstIntoIterKind trait

    Added konst::iter::CoerceTo type alias

    Added ConstIntoIter impl for &mut impl ConstIntoIter<Kind = IsIteratorKind>, that is for mutable references to iterators.

    Added ConstIntoIterKind bound to ConstIntoIter::Kind.

    Turned IntoIterWrapper::coerce methods into free function at konst::iter::coerce

    Added konst::iter::{repeat_n, RepeatN} iterator constructor and iterator struct.

    Removed rposition method from iterator macros, since it returned the distance from the end, not the start (bugfix).

    Changed drop behavior for iterators in iter::eval: iterators with ConstIntoIter::ITEMS_NEED_DROP == true are fully consumed after evaluating the methods passed to the macro, after which all iterators are mem::forget-ed.

    Changed IntoIterWrapper to only be constructible by konst::iter::coerce, and made its fields private.

    Fixed rev method of iterator macros: it can't be used if enumerate/take/take_while/skip/skip_while/zip were used before it, because the iterator without this restriction would produce different results than std::iter::Iterator would.

    Added these methods to iter::eval macro (conditional on "cmp" feature):

    • cmp
    • eq
    • ge
    • gt
    • is_sorted_by_key
    • is_sorted_by
    • is_sorted
    • le
    • lt
    • max_by_key
    • max_by
    • max
    • min_by_key
    • min_by
    • min
    • ne

    Changed all of the konst::parsing::Parser methods to use &mut self instead of taking and returning Parser by value, now every method mutates the Parser in place instead of returning a new Parser each time.
    The signatures of konst::parsing::Parser methods were changed in this way:

    • for (self) -> Self methods: changed into (&mut self) -> &mut Self
    • for (self, ..) -> Result<(T, Self), E> methods: changed into (&mut self, ..) -> Result<T, E>.
    • for (self, ..) -> Result<Self, E> methods: changed into (&mut self, ..) -> Result<&mut Self, E>.

    Removed Copy impl for Parser, added copy method for explicit copying.

    Renamed Parser::into_error to to_error and changed it from taking self to taking &self

    Renamed Parser::into_other_error into to_other_error, and from taking self to &self.

    Changed ParseError::new to take Parser by reference.

    Changed ParseError::other_error to take Parser by reference.

    Changed signature of ParseError::extra_message from returning &str to &'static str (the former tied the lifetime parameter of &str to the lifetime of the ParseError value)

    Renamed parse_with to parse_type and moved to konst::parsing

    Moved parser_method to konst::parsing

    Changed the parse_type macro from taking konst::parsing::Parser to automatically mutably borrowing it.

    Added const_panic::PanicFmt impls (used by konst::result::unwrap) for:

    • konst::parsing::ErrorKind
    • konst::parsing::ParseError
    • konst::parsing::ParseDirection
    • konst::primiive::ParseBoolError
    • konst::slice::TryIntoArrayError

    Changed Option macros to require Option by value when the equivalent methods takes Option by value (the macros used to allow passing Option by reference)

    Added const equivalents of Option-related items:

    • konst::option::get_or_insert_with (macro)
    • konst::option::get_or_insert (macro)
    • konst::option::insert (macro)
    • konst::option::into_iter (function, iterator constructor)
    • konst::option::IntoIter (struct, iterator)
    • konst::option::IntoIterRev (struct, iterator)
    • konst::option::is_none_or (macro)
    • konst::option::is_some_and (macro)
    • konst::option::iter_mut (function, iterator constructor)
    • konst::option::iter (function, iterator constructor)
    • konst::option::Iter (struct, iterator)
    • konst::option::IterMut (struct, iterator)
    • konst::option::IterMutRev (struct, iterator)
    • konst::option::IterRev (struct, iterator)
    • konst::option::unzip (function)
    • konst::option::zip (macro)

    Added support for Drop types in some Option macros:

    • konst::option::and_then
    • konst::option::map
    • konst::option::ok_or_else
    • konst::option::or_else
    • konst::option::unwrap_or_else

    Added ConstIntoIter impls for Option<T>/&Option<T>/&mut Option<T>

    Added missing impls of ConstCmp for Range and RangeInclusive types over signed integers.

    Added konst::range::OneSidedRange trait (currently only used by konst::slice::{split_off, split_off_mut})

    Added these items to konst::slice:

    • konst::slice::chunks_exact_mut (function, iterator constructor)
    • konst::slice::chunks_mut (function, iterator constructor)
    • konst::slice::ChunksExactMut (struct, iterator)
    • konst::slice::ChunksExactMutRev (struct, iterator)
    • konst::slice::ChunksMut (struct, iterator)
    • konst::slice::ChunksMutRev (struct, iterator)
    • konst::slice::fill_with (macro)
    • konst::slice::fill (function)
    • konst::slice::is_sorted_by_key (macro)
    • konst::slice::is_sorted_by (macro)
    • konst::slice::is_sorted (macro)
    • konst::slice::iter_mut (function, iterator constructor)
    • konst::slice::IterMut (struct, iterator)
    • konst::slice::IterMutRev (struct, iterator)
    • konst::slice::rchunks_exact_mut (function, iterator constructor)
    • konst::slice::rchunks_mut (function, iterator constructor)
    • konst::slice::RChunksExactMut (struct, iterator)
    • konst::slice::RChunksExactMutRev (struct, iterator)
    • konst::slice::RChunksMut (struct, iterator)
    • konst::slice::RChunksMutRev (struct, iterator)
    • konst::slice::split_off_first_mut (function)
    • konst::slice::split_off_first (function)
    • konst::slice::split_off_last_mut (function)
    • konst::slice::split_off_last (function)
    • konst::slice::split_off_mut (function)
    • konst::slice::split_off (function)

    Fixed RSplitTerminator: it used to skip the empty string before the first instance of the delimiter, instead of the empty space after the last one.
    The latter is what RSplitTerminator does now, to be consistent with std.

    Removed .rev() method of konst::string::{Split, RSplit}, because it allowed reversing an iterator with a &str needle, when std does not allow it (because the reverse iterator would produce different strings than forward).

    Reexported const_panic::unwrap_ok as konst::result::unwrap

    Changed Result macros to require passing Result by value whenever the equivalent method does.

    Changed konst's edition to 2024 and Minimum Supported Rust Version to 1.89.0.

    Added crate features:

    • "const_panic_derive": to enable const_panic's "derive" feature.

    Removed these crate features since the features they enabled are now always enabled:

    • "rust_1_83"
    • "mut_refs"
    • "nightly_mut_refs"

    Upgraded const_panic dependency to 0.2.13, enabled its "rust_1_88" feature

    Upgraded typewit dependency to 1.12, disabled its default feature, and enabled its "rust_1_83" feature.

    Open source →
    Release notes

    Removed these items because there is an equivalent built-in replacement:

    • konst::alloc_type::COW_STR_NEW: replaced by const { Cow::Borrowed("") }
    • konst::alloc_type::STRING_NEW: replaced by const { String::new() }
    • konst::alloc_type::VEC_NEW: replaced by const { Vec::new() }
    • konst::chr::from_u32_unchecked
    • konst::chr::from_u32
    • konst::ffi::cstr: CStr constructors are const, unwrappable with konst::result::unwrap
    • konst::konst macro: replaced by const { } blocks
    • konst::maybe_uninit::as_mut_ptr
    • konst::maybe_uninit::as_ptr
    • konst::maybe_uninit::assume_init_ref
    • konst::maybe_uninit::assume_init
    • konst::maybe_uninit::UNINIT: replaced by const { MaybeUninit::uninit() }
    • konst::option::copied
    • konst::option::flatten
    • konst::option::NONE: replaced by const { None }
    • konst::option::unwrap
    • konst::primitive::parse_i* functions: replaced by integer from_str_radix methods, unwrappable with konst::result::unwrap
    • konst::primitive::parse_u* functions: replaced by integer from_str_radix methods, unwrappable with konst::result::unwrap
    • konst::ptr::as_mut: replaced by &mut *pointer
    • konst::ptr::as_ref: replaced by &*pointer
    • konst::ptr::nonnull::as_mut
    • konst::ptr::nonnull::as_ref
    • konst::slice::as_chunks
    • konst::slice::as_rchunks
    • konst::slice::bytes_trim_end: replaced by <[u8]>::trim_ascii_end
    • konst::slice::bytes_trim_start: replaced by <[u8]>::trim_ascii_start
    • konst::slice::bytes_trim: replaced by <[u8]>::trim_ascii
    • konst::slice::first_mut
    • konst::slice::last_mut
    • konst::slice::split_first_mut
    • konst::slice::split_last_mut
    • konst::string::from_utf8
    • konst::string::is_char_boundary
    • string::trim_end: replaced by str::trim_ascii_end
    • string::trim_start: replaced by str::trim_ascii_start
    • string::trim: replaced by str::trim_ascii

    (the items in the list above without an explicit reason were replaced by a method or function of the same name)

    Removed these items because their unstable std equivalents were removed:

    • konst::slice::array_chunks
    • konst::slice::array_chunks_mut
    • konst::slice::ArrayChunks
    • konst::slice::ArrayChunksRev
    • konst::slice::ArrayChunksMut
    • konst::slice::ArrayChunksMutRev

    Removed these functions due to having an unsound impl:

    • konst::ptr::is_null
    • konst::ptr::nonnull::new

    Removed these items because they are not needed anymore:

    • konst::rebind_if_ok macro
    • konst::try_rebind macro
    • konst::polymorphism::type_eq_projection_fn macro: replaced by typewit::TypeFn+TypeEq::project
    • konst::unwrap_ctx macro: superceeded by konst::result::unwrap
    • panic methods: superceeded by const_panic::PanicFmt impls
    • konst::parsing::ParserResult: using the type it aliased instead of the alias
    • konst::parsing::ParseValueResult: using the type it aliased instead of the alias
    • konst::cmp::ConstCmpUnref: replaced by ConstCmp::This associated type

    Constrained macros that take closures from taking functions through :expr to :path, to keep the evaluation order of macros consistent with functions.

    Added these macros at the root module:

    • if_let_Some
    • while_let_Some

    Added konst::drop_flavor module with these items:

    • DropFlavor trait
    • DropFlavorWrapper trait
    • MayDrop marker type
    • NonDrop marker type
    • unwrap function
    • as_inner function
    • as_inner_mut function
    • wrap function

    Renameed konst::array::{map_, from_fn_} macros to map and from_fn respectively, replacing the old macros of the same name in the process.

    Changes to konst::array::ArrayConsumer:

    • renamed into IntoIter
    • impld ConstIntoIter for it
    • changed its next* methods to return Option<T> instead of Option<ManuallyDrop<T>> (to be consistent with ConstIntoIter API).
    • added D: DropFlavor parameter to konst::array::IntoIter to make it sometimes not need dropping
    • replaced new constructor with new of_copy and of_drop constructors.
    • added into_copy method
    • added into_drop method
    • added rev method

    Changes to konst::array::ArrayBuilder

    • added D: DropFlavor type parameter to make it sometimes not need dropping.
    • replaced new constructor with new of_copy and of_drop constructors.
    • added is_empty method
    • added into_copy method
    • added into_drop method

    Change: Made array items conditional on "iter" feature:

    • konst::array::ArrayBuilder
    • konst::array::from_fn
    • konst::array::IntoIter
    • konst::array::IntoIterRev
    • konst::array::map

    Added ConstIntoIter impl for arrays that uses konst::array::IntoIter<T, L, MayDrop> as the iterator.

    Added konst::array::IntoIterRev iterator.

    Added these items for ConstCmp overhaul;

    • konst::cmp::ConstCmp::This associated type
    • konst::cmp::ConstCmpKind trait
    • konst::cmp::CoerceTo type alias

    Removed IsRefKind reexport from konst::cmp and made it not a valid ConstCmp::Kind

    Merged all inherent coerce methods of IsAConstCmp into one generic method.

    Replaced CmpWrapper::slice constructor with from_ref, which takes any &T and converts it into &CmpWrapper<T>.

    Changed the precise type that std types are coerced into for having const_eq and const_cmp methods:

    • for arrays: instead of converting &[T; N] to CmpWrapper<&[T]>, it's converted to &CmpWrapper<[T; N]>
    • slices: instead of converting &[T] to CmpWrapper<&[T]>, it's converted to &<[T]>
    • strs: instead of converting &str to CmpWrapper<&str>, it's converted to &str
    • every other std type: instead of converting &T to CmpWrapper<T>, it's converted to &CmpWrapper<T>

    Moved these macros to konst::cmp module:

    • coerce_to_cmp
    • const_cmp
    • const_cmp_for
    • const_eq
    • const_eq_for
    • impl_cmp
    • max
    • max_by
    • max_by_key
    • min
    • min_by
    • min_by_key
    • try_equal

    Changed konst::cmp::{const_cmp_for, const_eq_for} to borrow their slice arguments

    Added these comparison macros:

    • konst::cmp::const_ge
    • konst::cmp::const_ge_for
    • konst::cmp::const_gt
    • konst::cmp::const_gt_for
    • konst::cmp::const_le
    • konst::cmp::const_le_for
    • konst::cmp::const_lt
    • konst::cmp::const_lt_for
    • konst::cmp::const_ne
    • konst::cmp::const_ne_for

    Fixed how const_cmp_for macro and const_cmp methods compared slices for ordering, they used to consider all slices less than all longer slices. Now const_cmp!(short_slice, longer_slice) only returns Less if all elements of short_slice are less than or equal to the longer_slice elements at the same index.

    Turned iterators from taking Self and returning Option<(Self::Item, Self)> into taking &mut Self and returning Option<Self::Item>.

    Removed support for lifetime promotion in return value of iterator methods in iterator macros, i.e.: there's no guarantee that the returned reference be usable in the following methods.

    Added konst::iter::ConstIntoIter::ITEMS_NEED_DROP associated constant

    Added konst::iter::ConstIntoIterKind trait

    Added konst::iter::CoerceTo type alias

    Added ConstIntoIter impl for &mut impl ConstIntoIter<Kind = IsIteratorKind>, that is for mutable references to iterators.

    Added ConstIntoIterKind bound to ConstIntoIter::Kind.

    Turned IntoIterWrapper::coerce methods into free function at konst::iter::coerce

    Added konst::iter::{repeat_n, RepeatN} iterator constructor and iterator struct.

    Removed rposition method from iterator macros, since it returned the distance from the end, not the start (bugfix).

    Changed drop behavior for iterators in iter::eval: iterators with ConstIntoIter::ITEMS_NEED_DROP == true are fully consumed after evaluating the methods passed to the macro, after which all iterators are mem::forget-ed.

    Changed IntoIterWrapper to only be constructible by konst::iter::coerce, and made its fields private.

    Fixed rev method of iterator macros: it can't be used if enumerate/take/take_while/skip/skip_while/zip were used before it, because the iterator without this restriction would produce different results than std::iter::Iterator would.

    Added these methods to iter::eval macro (conditional on "cmp" feature):

    • cmp
    • eq
    • ge
    • gt
    • is_sorted_by_key
    • is_sorted_by
    • is_sorted
    • le
    • lt
    • max_by_key
    • max_by
    • max
    • min_by_key
    • min_by
    • min
    • ne

    Changed all of the konst::parsing::Parser methods to use &mut self instead of taking and returning Parser by value, now every method mutates the Parser in place instead of returning a new Parser each time. The signatures of konst::parsing::Parser methods were changed in this way:

    • for (self) -> Self methods: changed into (&mut self) -> &mut Self
    • for (self, ..) -> Result<(T, Self), E> methods: changed into (&mut self, ..) -> Result<T, E>.
    • for (self, ..) -> Result<Self, E> methods: changed into (&mut self, ..) -> Result<&mut Self, E>.

    Removed Copy impl for Parser, added copy method for explicit copying.

    Renamed Parser::into_error to to_error and changed it from taking self to taking &self

    Renamed Parser::into_other_error into to_other_error, and from taking self to &self.

    Changed ParseError::new to take Parser by reference.

    Changed ParseError::other_error to take Parser by reference.

    Changed signature of ParseError::extra_message from returning &str to &'static str (the former tied the lifetime parameter of &str to the lifetime of the ParseError value)

    Renamed parse_with to parse_type and moved to konst::parsing

    Moved parser_method to konst::parsing

    Changed the parse_type macro from taking konst::parsing::Parser to automatically mutably borrowing it.

    Added const_panic::PanicFmt impls (used by konst::result::unwrap) for:

    • konst::parsing::ErrorKind
    • konst::parsing::ParseError
    • konst::parsing::ParseDirection
    • konst::primiive::ParseBoolError
    • konst::slice::TryIntoArrayError

    Changed Option macros to require Option by value when the equivalent methods takes Option by value (the macros used to allow passing Option by reference)

    Added const equivalents of Option-related items:

    • konst::option::get_or_insert_with (macro)
    • konst::option::get_or_insert (macro)
    • konst::option::insert (macro)
    • konst::option::into_iter (function, iterator constructor)
    • konst::option::IntoIter (struct, iterator)
    • konst::option::IntoIterRev (struct, iterator)
    • konst::option::is_none_or (macro)
    • konst::option::is_some_and (macro)
    • konst::option::iter_mut (function, iterator constructor)
    • konst::option::iter (function, iterator constructor)
    • konst::option::Iter (struct, iterator)
    • konst::option::IterMut (struct, iterator)
    • konst::option::IterMutRev (struct, iterator)
    • konst::option::IterRev (struct, iterator)
    • konst::option::unzip (function)
    • konst::option::zip (macro)

    Added support for Drop types in some Option macros:

    • konst::option::and_then
    • konst::option::map
    • konst::option::ok_or_else
    • konst::option::or_else
    • konst::option::unwrap_or_else

    Added ConstIntoIter impls for Option<T>/&Option<T>/&mut Option<T>

    Added missing impls of ConstCmp for Range and RangeInclusive types over signed integers.

    Added konst::range::OneSidedRange trait (currently only used by konst::slice::{split_off, split_off_mut})

    Added these items to konst::slice:

    • konst::slice::chunks_exact_mut (function, iterator constructor)
    • konst::slice::chunks_mut (function, iterator constructor)
    • konst::slice::ChunksExactMut (struct, iterator)
    • konst::slice::ChunksExactMutRev (struct, iterator)
    • konst::slice::ChunksMut (struct, iterator)
    • konst::slice::ChunksMutRev (struct, iterator)
    • konst::slice::fill_with (macro)
    • konst::slice::fill (function)
    • konst::slice::is_sorted_by_key (macro)
    • konst::slice::is_sorted_by (macro)
    • konst::slice::is_sorted (macro)
    • konst::slice::iter_mut (function, iterator constructor)
    • konst::slice::IterMut (struct, iterator)
    • konst::slice::IterMutRev (struct, iterator)
    • konst::slice::rchunks_exact_mut (function, iterator constructor)
    • konst::slice::rchunks_mut (function, iterator constructor)
    • konst::slice::RChunksExactMut (struct, iterator)
    • konst::slice::RChunksExactMutRev (struct, iterator)
    • konst::slice::RChunksMut (struct, iterator)
    • konst::slice::RChunksMutRev (struct, iterator)
    • konst::slice::split_off_first_mut (function)
    • konst::slice::split_off_first (function)
    • konst::slice::split_off_last_mut (function)
    • konst::slice::split_off_last (function)
    • konst::slice::split_off_mut (function)
    • konst::slice::split_off (function)

    Fixed RSplitTerminator: it used to skip the empty string before the first instance of the delimiter, instead of the empty space after the last one. The latter is what RSplitTerminator does now, to be consistent with std.

    Removed .rev() method of konst::string::{Split, RSplit}, because it allowed reversing an iterator with a &str needle, when std does not allow it (because the reverse iterator would produce different strings than forward).

    Reexported const_panic::unwrap_ok as konst::result::unwrap

    Changed Result macros to require passing Result by value whenever the equivalent method does.

    Changed konst's edition to 2024 and Minimum Supported Rust Version to 1.89.0.

    Added crate features:

    • "const_panic_derive": to enable const_panic's "derive" feature.

    Removed these crate features since the features they enabled are now always enabled:

    • "rust_1_83"
    • "mut_refs"
    • "nightly_mut_refs"

    Upgraded const_panic dependency to 0.2.13, enabled its "rust_1_88" feature

    Upgraded typewit dependency to 1.12, disabled its default feature, and enabled its "rust_1_83" feature.

    0.3

    Open source →
  5. 0.3.17 16 Apr 2026
    Release notes

    Fixed compilation error in konst::ptr module on Rust nightly 2026-04-09.

    Open source →
  6. 0.3.16 29 Dec 2024
    Release notes

    Deprecated these functions due to unsoundness:

    • konst::ptr::is_null
    • konst::ptr::nonnull::new
    Open source →
  7. 0.3.15 06 Dec 2024
    Release notes

    This release enables all &mut-taking const functions in Rust 1.83.0, provides ArrayBuilder/ArrayConsumer array helpers, and the konst::manually_drop::take function.

    Changelog

    0.3.15

    Soft-removed "mut_refs" and "nightly_mut_refs" feature (by hidding it in docs), changed to using "rust_1_83" feature to enable &mut-taking const fns.
    (to avoid breakage, "mut_refs" still enables items that use &mut in const by enabling "rust_latest_stable")

    Changed "rust_latest_stable" feature to enable "rust_1_83" feature.

    Added konst::manually_drop::take function

    Added these structs to konst::array:

    • ArrayBuilder
    • ArrayConsumer

    0.3.14

    Fixed accidental inclusion of private macros in docs.

    Open source →
    Release notes

    Soft-removed "mut_refs" and "nightly_mut_refs" feature (by hidding it in docs), changed to using "rust_1_83" feature to enable &mut-taking const fns. (to avoid breakage, "mut_refs" still enables items that use &mut in const by enabling "rust_latest_stable")

    Changed "rust_latest_stable" feature to enable "rust_1_83" feature.

    Added konst::manually_drop::take function

    Added these structs to konst::array:

    • ArrayBuilder
    • ArrayConsumer
    Open source →
  8. 0.3.14 24 Nov 2024
    Release notes

    Fixed accidental inclusion of private macros in docs.

    Open source →
  9. 0.3.13 24 Nov 2024 withdrawn

    Nothing published for this version

  10. 0.3.12 22 Nov 2024 withdrawn
    Release notes

    This release adds closer const equivalents to <[T; N]>::{from_fn, map}, without the limitations of the previous macro equivalents.

    Changelog

    0.3.12

    Changed konst::array::from_fn macro to allow unparenthesized type to the left of the `=>

    Added these macros in konst::array (which require the "rust_1_83" feature):

    • map_
    • from_fn_
    Open source →
    Release notes

    Changed konst::array::from_fn macro to allow unparenthesized type to the left of the `=>

    Added these macros in konst::array (which require the "rust_1_83" feature):

    • map_
    • from_fn_
    Open source →
  11. 0.3.11 20 Nov 2024

    Nothing published for this version

  12. 0.3.10 20 Nov 2024
    Release notes

    This release adds a destructure macro to destructure (non-Drop) structs/tuples/arrays into their potentially fields/elements in const.
    This macro requires the 1.83.0 Rust release, which will reach the stable channel on 2024-11-28.

    0.3

    0.3.10

    Added "rust_1_83" feature, which enables the "mut_refs" feature.

    Added "destructure" macro (requires the "rust_1_83" feature)

    Fixed future compatibility warnings

    0.3.9

    Defined these macros max, max_by, max_by_key, min, min_by, and min_by_key macros.

    Re-exported these macros in the konst::cmp module:

    • coerce_to_cmp
    • const_cmp
    • const_cmp_for
    • const_eq
    • const_eq_for
    • impl_cmp
    • max
    • max_by
    • max_by_key
    • min
    • min_by
    • min_by_key

    Now the fold and foldr methods in konst::iter::eval can take closures with type-annotated parameters (e.g: |accum: Bar, element: Qux| {)

    0.3.8

    Removed most Copy restriction of these macros:

    • konst::array::from_fn
    • konst::array::map
    • konst::iter::collect_const
      The pattern of the closure passed to konst::array::map is still required not to move out of the input array.

    Improved konst::array::{from_fn, map} macros by allowing its closure parameter to take more unparenthesized patterns.

    Improved the konst::iter::{collect_const, eval, for_each} macros by allowing single-parameter closures passed to the macro to annotate the type of the parameter.

    Open source →
    Release notes

    Added "rust_1_83" feature, which enables the "mut_refs" feature.

    Added "destructure" macro (requires the "rust_1_83" feature)

    Fixed future compatibility warnings

    Open source →
  13. 0.3.9 17 Apr 2024
    Release notes

    Defined these macros max, max_by, max_by_key, min, min_by, and min_by_key macros.

    Re-exported these macros in the konst::cmp module:

    • coerce_to_cmp
    • const_cmp
    • const_cmp_for
    • const_eq
    • const_eq_for
    • impl_cmp
    • max
    • max_by
    • max_by_key
    • min
    • min_by
    • min_by_key

    Now the fold and foldr methods in konst::iter::eval can take closures with type-annotated parameters (e.g: |accum: Bar, element: Qux| {)

    Open source →
  14. 0.3.8 06 Dec 2023
    Release notes

    Removed most Copy restriction of these macros:

    • konst::array::from_fn
    • konst::array::map
    • konst::iter::collect_const The pattern of the closure passed to konst::array::map is still required not to move out of the input array.

    Improved konst::array::{from_fn, map} macros by allowing its closure parameter to take more unparenthesized patterns.

    Improved the konst::iter::{collect_const, eval, for_each} macros by allowing single-parameter closures passed to the macro to annotate the type of the parameter.

    Open source →
  15. 0.3.7 28 Nov 2023
    Release notes

    The 0.3.7 release adds a few chunky slice functions, and fixes an iterator method.

    Changelog

    0.3.7

    Fixed ChunksExact::remainder's implementation, it used to return the entire uniterated-over slice, when it should only return the part of the slice that the iterator never yields.

    Added these items to konst::slice module:

    • ArrayChunksRev struct
    • ArrayChunks struct
    • RChunksExactRev struct
    • RChunksExact struct
    • RChunksRev struct
    • RChunks struct
    • array_chunks function
    • as_chunks function
    • as_rchunks function
    • rchunks_exact function
    • rchunks function

    0.3.6

    Changed type_eq_projection_fn macro to not use any unsafe, this may require fixing bounds in your code.

    0.3.5

    Added typewit = "1.1" dependency.

    Removed konst::docs module.

    Replaced konst::polymorphism::{HasTypeWitness,MakeTypeWitness,TypeWitnessTypeArg,TypeEq} from the same-named items in typewit

    Added reexport of typewit::{self, CallFn, simple_type_witness,TypeFn,type_fn} in konst::polymorphism

    0.3.4

    Fixed Parser::parse_direction's const-ness by making it a const fn.

    Open source →
    Release notes

    Fixed ChunksExact::remainder's implementation, it used to return the entire uniterated-over slice, when it should only return the part of the slice that the iterator never yields.

    Added these items to konst::slice module:

    • ArrayChunksRev struct
    • ArrayChunks struct
    • RChunksExactRev struct
    • RChunksExact struct
    • RChunksRev struct
    • RChunks struct
    • array_chunks function
    • as_chunks function
    • as_rchunks function
    • rchunks_exact function
    • rchunks function
    Open source →
  16. 0.3.6 02 Aug 2023
    Release notes

    Changed type_eq_projection_fn macro to not use any unsafe, this may require fixing bounds in your code.

    Open source →
  17. 0.3.5 01 May 2023
    Release notes

    Added typewit = "1.1" dependency.

    Removed konst::docs module.

    Replaced konst::polymorphism::{HasTypeWitness,MakeTypeWitness,TypeWitnessTypeArg,TypeEq} from the same-named items in typewit

    Added reexport of typewit::{self, CallFn, simple_type_witness,TypeFn,type_fn} in konst::polymorphism

    Open source →
  18. 0.3.4 11 Nov 2022
    Release notes

    Fixed Parser::parse_direction's const-ness by making it a const fn.

    Open source →
  19. 0.3.3 09 Nov 2022

    Nothing published for this version

  20. 0.3.2 09 Nov 2022

    Nothing published for this version

  21. 0.3.1 09 Nov 2022

    Nothing published for this version

  22. 0.3.0 08 Nov 2022
    Release notes

    This release does many API cleanups and additions by using language features from the newest stable releases.

    Changelog

    Removed konst::array::try_into_array macro (it's superceeded by the function of the same name)

    Removed these functions because the std equivalent is stably const:

    • konst::maybe_uninit::{as_ptr, assume_init, assume_init_ref}
    • konst::ptr::{deref, deref_mut}
    • konst::slice::{first, last, split_first, split_last}

    Removed extra from parameter of:

    • konst::slice::{bytes_contain, bytes_rcontain, bytes_find, bytes_rfind}
    • konst::string::{find, contains, rfind, rcontains}

    Added these items in konst::polymorphism:

    • HasTypeWitness(trait)
    • MakeTypeWitness(trait)
    • TypeEq(struct)
    • TypeWitnessTypeArg(trait)
    • type_eq_projection_fn(macro)

    Added konst::docs::type_witnesses documentation module.

    Added konst::chr module, with these items:

    • Utf8Encoded
    • encode_utf8
    • from_u32_unchecked
    • from_u32

    Renamed IntoIterKind to ConstIntoIter.

    Added Item and IntoIter assoc types to ConstIntoIter, and added checks in iterator macros that Item matches the item's type.

    Moved comparison-related from konst::polymorphism to new konst::cmp module.

    Renamed ConstCmpMarker to ConstCmp.

    Renamed these marker types:

    • IsAConstCmpMarker to IsAConstCmp
    • IsIntoIterKind to IsConstIntoIter
    • IsNonIteratorKind to IsIntoIterKind (not to be confused with the previous name for the trait ConstIntoIter trait)

    Removed konst::polymorphism::IsArrayKind

    Added konst::polymorphism::IsRefKind

    Added konst::cmp::ConstCmpUnref traits.

    Moved all Is*Kind field-less structs to konst::polymorphism::kinds, made them all 0-variant enums, and reexported the relevant items in konst::cmp and konst::iter.

    Removed ConstCmp::This associated type, now it's derived with ConstCmpUnref.

    Added konst::slice::BytesPattern trait, implemented for char, [u8], [u8; N], and str.

    Made the second parameter of konst::slice::bytes_* functions take a generic BytesPattern.

    Added konst::string::Pattern trait, implemented for char and &str

    Made string functions take P: Pattern<'s> as the pattern argument.

    Added const_panic = "0.2" depdendency to konst

    Made all panicking code use const_panic to have the same error messages as at runtime (previously use array indexing hack to panic).

    Added konst::array::from_fn macro.

    Added konst::iter::{repeat, Repeat}.

    Added iteration over ranges of non-usize integers and char.

    Added konst::iter::Step trait.

    Added konst::ffi::cstr module.

    Reexporting konst::iter::step::Step in konst::iter

    Added these konst::string items:

    • Chars(struct)
    • RChars(struct)
    • CharIndices(struct)
    • RCharIndices(struct)
    • char_indices(function)
    • chars(function)
    • from_iter(macro)
    • is_char_boundary(function)
    • str_concat(macro)
    • str_join(macro)

    Rewrote Parser to only support parsing &str.

    Added Parser::{skip, skip_back} methods

    Removed these parser functions:

    • Parser::*_b
    • Parser::*_u8 (except for parse_u8)
    • Parser::advance_*
    • Parser::from_bytes

    Renamed these Parser functions:

    • from_str to new.
    • bytes to remainder (and takes &str)

    Added these Parser methods:

    • into_other_error
    • rsplit_terminator
    • rsplit
    • split_keep
    • split_terminator
    • split
    • skip
    • skip_back
    • trim
    • trim_matches
    • with_start_offset

    Added ParseError::other_error function for constructing Other errors with custom error messages.

    Added FromBoth variant to konst::parser::ParseDirection

    Renamed ParserFor trait to HasParser

    Added SplitExhausted,DelimiterNotFound variants to konst::parsing::ErrorKind

    Removed map_err capability of try_rebind due to being untested and unused.

    Removed unwrap_opt_or and unwrap_res_or macros (they are superceeded by other macros).

    Made array::map and iterator-taking macros support specifying an explicit return type.

    Added assertc_eq, assertc_ne macros.

    Added type annotation support to rebind_if_ok macro (for the pattern as a whole).

    Fixed support for continue and break inside of konst::for_range.

    Changed Parser methods from taking &str patterns to taking any P: Pattern<'p>

    Renamed parse_any macro to parser_method

    Removed konst::primitive::parse_*_b functions

    Renamed "parsing" feature to "parsing_proc" and "parsing_no_proc" feature to "parsing"

    Added "iter" feature(enabled by default), feature-gating all iterator-related items.

    Added "debug" feature for additional safety checks in konst unsafe code.

    Made konst crate 2021 edition, resolver="2".

    Bumped minimum supported Rust versions to 1.65.0

    Removed all "rust_1_*" features, and all old-version-dependent code.

    Renamed konst_macro_rules to konst_kernel crate, which defines items for reexporting in konst (mostly needed for having macros in submodules).

    Open source →
    Release notes

    Removed konst::array::try_into_array macro (it's superceeded by the function of the same name)

    Removed functions

    Removed these functions because the std equivalent is stably const:

    • konst::maybe_uninit::{as_ptr, assume_init, assume_init_ref}
    • konst::ptr::{deref, deref_mut}
    • konst::slice::{first, last, split_first, split_last}

    Removed extra from parameter of:

    • konst::slice::{bytes_contain, bytes_rcontain, bytes_find, bytes_rfind}
    • konst::string::{find, contains, rfind, rcontains}

    Added these items in konst::polymorphism:

    • HasTypeWitness(trait)
    • MakeTypeWitness(trait)
    • TypeEq(struct)
    • TypeWitnessTypeArg(trait)
    • type_eq_projection_fn(macro)

    Added konst::docs::type_witnesses documentation module.

    Added konst::chr module, with these items:

    • Utf8Encoded
    • encode_utf8
    • from_u32_unchecked
    • from_u32

    Renamed IntoIterKind to ConstIntoIter.

    Added Item and IntoIter assoc types to ConstIntoIter, and added checks in iterator macros that Item matches the item's type.

    Moved comparison-related from konst::polymorphism to new konst::cmp module.

    Renamed ConstCmpMarker to ConstCmp.

    Renamed these marker types:

    • IsAConstCmpMarker to IsAConstCmp
    • IsIntoIterKind to IsConstIntoIter
    • IsNonIteratorKind to IsIntoIterKind (not to be confused with the previous name for the trait ConstIntoIter trait)

    Removed konst::polymorphism::IsArrayKind

    Added konst::polymorphism::IsRefKind

    Added konst::cmp::ConstCmpUnref traits.

    Moved all Is*Kind field-less structs to konst::polymorphism::kinds, made them all 0-variant enums, and reexported the relevant items in konst::cmp and konst::iter.

    Removed ConstCmp::This associated type, now it's derived with ConstCmpUnref.

    Added konst::slice::BytesPattern trait, implemented for char, [u8], [u8; N], and str.

    Made the second parameter of konst::slice::bytes_* functions take a generic BytesPattern.

    Added konst::string::Pattern trait, implemented for char and &str

    Made string functions take P: Pattern<'s> as the pattern argument.

    Bumped minimum supported Rust versions to 1.65.0

    Added const_panic = "0.2" depdendency to konst

    Made all panicking code use const_panic to have the same error messages as at runtime (previously use array indexing hack to panic).

    Added konst::array::from_fn macro.

    Added konst::iter::{repeat, Repeat}.

    Added iteration over ranges of non-usize integers and char.

    Added konst::iter::Step trait.

    Added konst::ffi::cstr module.

    Reexporting konst::iter::step::Step in konst::iter

    Added these konst::string items:

    • Chars(struct)
    • RChars(struct)
    • CharIndices(struct)
    • RCharIndices(struct)
    • char_indices(function)
    • chars(function)
    • from_iter(macro)
    • is_char_boundary(function)
    • str_concat(macro)
    • str_join(macro)

    Rewrote Parser to only support parsing &str.

    Added Parser::{skip, skip_back} methods

    Removed these parser functions:

    • Parser::*_b
    • Parser::*_u8 (except for parse_u8)
    • Parser::advance_*
    • Parser::from_bytes

    Renamed these Parser functions:

    • from_str to new.
    • bytes to remainder (and takes &str)

    Added these Parser methods:

    • into_other_error
    • rsplit_terminator
    • rsplit
    • split_keep
    • split_terminator
    • split
    • skip
    • skip_back
    • trim
    • trim_matches
    • with_start_offset

    Added ParseError::other_error function for constructing Other errors with custom error messages.

    Added FromBoth variant to konst::parser::ParseDirection

    Renamed ParserFor trait to HasParser

    Added SplitExhausted,DelimiterNotFound variants to konst::parsing::ErrorKind

    Removed map_err capability of try_rebind due to being untested and unused.

    Removed unwrap_opt_or and unwrap_res_or macros (they are superceeded by other macros).

    Made array::map and iterator-taking macros support specifying an explicit return type.

    Added assertc_eq, assertc_ne macros.

    Added type annotation support to rebind_if_ok macro (for the pattern as a whole).

    Fixed support for continue and break inside of konst::for_range.

    Changed Parser methods from taking &str patterns to taking any P: Pattern<'p>

    Renamed parse_any macro to parser_method

    Removed konst::primitive::parse_*_b functions

    Renamed "parsing" feature to "parsing_proc" and "parsing_no_proc" feature to "parsing"

    Added "iter" feature(enabled by default), feature-gating all iterator-related items.

    Added "debug" feature for additional safety checks in konst unsafe code.

    Made konst crate 2021 edition, resolver="2".

    Removed all "rust_1_*" features, and all old-version-dependent code.

    Renamed konst_macro_rules to konst_kernel crate, which defines items for reexporting in konst (mostly needed for having macros in submodules).

    0.2

    Open source →
  23. 0.2.20 16 Apr 2026
    Release notes

    Fixed compilation error in konst::ptr module on Rust nightly 2026-04-09.

    Open source →
  24. 0.2.19 09 Oct 2022
    Release notes

    Addeded konst::iter module, with const encodings of Iterator API:

    • konst::iter::collect_const (macro)
    • konst::iter::eval (macro)
    • konst::iter::for_each (macro)
    • konst::iter::into_iter (macro)
    • konst::iter::iterator_dsl (documentation module)
    • konst::iter::IntoIterWrapper (struct)
    • konst::iter::IsIntoIterKind (struct)
    • konst::iter::IsIteratorKind (struct)
    • konst::iter::IsNonIteratorKind (struct)
    • konst::iter::IsStdKind (struct)
    • konst::iter::IntoIterKind(trait)

    Added these const fn (enabled by the "rust_1_64" feature):

    • konst::string::split
    • konst::string::rsplit
    • konst::string::split_terminator
    • konst::string::rsplit_terminator
    • konst::string::split_once
    • konst::string::rsplit_once

    Added these const string iterators (enabled by the "rust_1_64" feature):

    • konst::string::Split
    • konst::string::RSplit
    • konst::string::SplitTerminator
    • konst::string::RSplitTerminator

    Added these slice functions:

    • konst::slice::chunks(requires the "rust_1_64" feature)
    • konst::slice::chunks_exact(requires the "rust_1_64" feature)
    • konst::slice::iter
    • konst::slice::iter_copied(requires the "rust_1_61" feature)
    • konst::slice::windows (requires the "rust_1_64" feature)

    Added these slice iterator types:

    • konst::slice::Chunks (requires the "rust_1_64" feature)
    • konst::slice::ChunksRev (requires the "rust_1_64" feature)
    • konst::slice::ChunksExact (requires the "rust_1_64" feature)
    • konst::slice::ChunksExactRev (requires the "rust_1_64" feature)
    • konst::slice::Iter
    • konst::slice::IterRev
    • konst::slice::IterCopied (requires the "rust_1_61" feature)
    • konst::slice::IterCopiedRev (requires the "rust_1_61" feature)
    • konst::slice::Windows (requires the "rust_1_64" feature)
    • konst::slice::WindowsRev (requires the "rust_1_64" feature)

    Added range iterator types:

    • konst::range::RangeIter
    • konst::range::RangeIterRev
    • konst::range::RangeInclusiveIter
    • konst::range::RangeInclusiveIterRev
    • konst::range::RangeFromIter

    Added konst::option::copied function (requires the "rust_1_61" feature)

    Added "rust_1_51" feature, made "const_generics" feature delegate to it.

    Added "rust_1_57" feature, which enables the "rust_1_56" feature.

    Added "rust_1_61" feature, which enables the "rust_1_57" feature.

    Changed "rust_1_64" feature: now it enables "rust_1_61" feature.

    Added "rust_latest_stable" feature that enables the latest "rust_*" feature.

    Open source →
  25. 0.2.18 18 Sep 2022

    Nothing published for this version

  26. 0.2.17 18 Sep 2022

    Nothing published for this version

  27. 0.2.16 18 Sep 2022
    Release notes

    Added "rust_1_64" crate feature, to make slice indexing take constant time from Rust 1.64.0 onwards.

    Changed "constant_time_slice" to enable "rust_1_64" feature.

    Open source →
  28. 0.2.15 05 Jul 2022

    Nothing published for this version

  29. 0.2.14 05 Jul 2022
    Release notes

    Made "deref_raw_in_fn" feature only require Rust 1.56.0 by stopping the use of an (already stabilized) nightly feature flag.

    Open source →
  30. 0.2.13 18 Sep 2021
    Release notes

    Added these functions:

    • konst::manually_drop::as_inner (requires the "rust_1_56" feature).
    • konst::manually_drop::as_inner_mut (requires the "mut_refs" feature).

    Added these MaybeUninit functions:

    • konst::maybe_uninit::array_assume_init (requires the "rust_1_56" feature)
    • konst::maybe_uninit::as_mut_ptr (requires the "mut_refs" feature)
    • konst::maybe_uninit::as_ptr
    • konst::maybe_uninit::assume_init_mut (requires the "mut_refs" feature)
    • konst::maybe_uninit::assume_init_ref (requires the "rust_1_56" feature)
    • konst::maybe_uninit::assume_init (requires the "rust_1_56" feature)
    • konst::maybe_uninit::uninit_array (requires the "rust_1_56" feature)
    • konst::maybe_uninit::write (requires the "mut_refs" feature)

    Added these raw pointer/NonNull functins:

    • konst::ptr::as_mut (requires the "mut_refs" feature)
    • konst::ptr::as_ref (requires the "rust_1_56" feature)
    • konst::ptr::deref_mut (requires the "mut_refs" feature)
    • konst::ptr::deref (requires the "rust_1_56" feature)
    • konst::ptr::is_null (requires the "rust_1_56" feature)
    • konst::ptr::non_null::as_mut (requires the "mut_refs" feature)
    • konst::ptr::non_null::as_ref (requires the "rust_1_56" feature)
    • konst::ptr::non_null::from_mut (requires the "mut_refs" feature)
    • konst::ptr::non_null::from_ref
    • konst::ptr::non_null::new (requires the "rust_1_56" feature)
    Open source →
  31. 0.2.12 14 Sep 2021
    Release notes

    Added konst::array::map, which requires the rust_1_56 feature.

    Open source →
  32. 0.2.11 11 Sep 2021

    Nothing published for this version

  33. 0.2.10 20 Aug 2021
    Release notes

    Added "rust_1_55" and "rust_1_56" features.

    Change: functions that required the "deref_raw_in_fn" feature can be used on Rust 1.56.0 (whenever that reaches stable) with the "rust_1_56" feature.

    Added these slice functions

    • konst::slice::bytes_find_keep
    • konst::slice::bytes_find_skip
    • konst::slice::bytes_rfind_keep
    • konst::slice::bytes_rfind_skip
    • konst::slice::bytes_trim_end_matches
    • konst::slice::bytes_trim_end
    • konst::slice::bytes_trim_matches
    • konst::slice::bytes_trim_start_matches
    • konst::slice::bytes_trim_start
    • konst::slice::bytes_trim
    • konst::slice::get_from_mut (requires the "mut_refs" feature)
    • konst::slice::get_from
    • konst::slice::get_mut (requires the "mut_refs" feature)
    • konst::slice::get_range_mut (requires the "mut_refs" feature)
    • konst::slice::get_range
    • konst::slice::get_up_to_mut (requires the "mut_refs" feature)
    • konst::slice::get_up_to
    • konst::slice::get

    Added these str functions, all of which require the "rust_1_55" feature:

    • konst::string::from_utf8
    • konst::string::get_from
    • konst::string::get_range
    • konst::string::get_up_to
    • konst::string::split_at
    • konst::string::str_from
    • konst::string::str_range
    • konst::string::strip_prefix
    • konst::string::strip_suffix
    • konst::string::str_up_to
    • konst::string::trim
    • konst::string::trim_start
    • konst::string::trim_end
    • konst::string::trim_matches
    • konst::string::trim_start_matches
    • konst::string::trim_end_matches
    • konst::string::find_skip
    • konst::string::find_keep
    • konst::string::rfind_skip
    • konst::string::rfind_keep

    Renamed these functions, reexported with old name, and deprecated the reexport:

    • string::str_starts_with: renamed to string::starts_with
    • string::str_ends_with: renamed to string::ends_with
    • string::str_find: renamed to string::find
    • string::str_contains: renamed to string::contains
    • string::str_rfind: renamed to string::rfind
    • string::str_rcontains: renamed to string::rcontains

    Added the konst::string::from_utf8 macro.

    Added konst::string::Utf8Error error struct.

    Open source →
  34. 0.2.9 15 Aug 2021
    Release notes

    Fixed internal soundness bug in where unions weren't #[repr(C))].

    Open source →
  35. 0.2.8 13 Aug 2021

    Nothing published for this version

  36. 0.2.7 13 Aug 2021
    Release notes

    Added the "mut_refs", "nightly_mut_refs" features for const fns that take mutable references.

    Added these mutable slice functions:

    • konst::slice::first_mut
    • konst::slice::last_mut
    • konst::slice::slice_from_mut
    • konst::slice::slice_range_mut
    • konst::slice::slice_up_to_mut
    • konst::slice::split_at_mut
    • konst::slice::split_first_mut
    • konst::slice::split_last_mut
    • konst::slice::try_into_array_mut
    Open source →
  37. 0.2.6 01 Aug 2021

    Nothing published for this version

  38. 0.2.5 30 Jul 2021
    Release notes

    Added ParseFor trait and parse_with macro, for type-dispatched parsing.

    Added StdParser struct as the parser for std types.

    Broadened valid syntax for try_rebind/rebind_if_ok

    Added trailing comma support to every macros, where applicable

    Open source →
  39. 0.2.4 31 Mar 2021
    Release notes

    Fixed handling of length argument of slice::try_into_array macro, when the "const_generics" feature is enabled, it would previously require non-trivial expressions to be wrapped in braces.

    Open source →
  40. 0.2.3 30 Mar 2021
    Release notes

    Added the slice::try_into_array macro and nightly function to try to convert &[T] to &[T; N]

    Defined the slice::TryIntoArrayError as the error type for slice::try_into_array

    Added slice::{first, last, split_first, split_last} functions, const equivalents of the slice methods.

    Added these (generic) constants, which can be used in [CONST; LEN] even for non-Copy types:

    • option::NONE: alias for None
    • alloc_type::COW_STR_NEW: An empty Cow<'_, str<
    • alloc_type::COW_SLICE_NEW: An empty Cow<'_, [T]>
    • alloc_type::STRING_NEW: An empty String
    • alloc_type::VEC_NEW}: An empty Vec<T>
    • maybe_uninit::UNINIT: An uninit MaybeUninit<T>
    • maybe_uninit::UNINIT_ARRAY: An uninit [MaybeUninit<T>; LEN]

    Added "deref_raw_in_fn" feature to enable const fns that need to dereference raw pointers, requires the nightly compiler.

    Added "alloc" feature to enable the alloc_type module.

    Open source →
  41. 0.2.2 27 Mar 2021

    Nothing published for this version

  42. 0.2.1 27 Mar 2021
    Release notes

    Defined the konst_macro_rules crate 0.2.0, to reexport macros in konst submodules.

    Added macro equivalents of Option::{and_then, filter, map, ok_or, ok_or_else, or_else, unwrap_or, unwrap_or_else, flatten} in the konst::option module.

    Added macro equivalents of Result::{unwrap_ctx, unwrap_or, unwrap_or_else, ok, err, map, map_err, and_then, or_else} in the konst::result module.

    Deprecated the unwrap_opt_or, and unwrap_res_or macros.

    Defined result::unwrap_err_or_else macro for convenience.

    Added try_ and try_opt macros

    Added primitive::parse_* functions, to parse all integer types and bool from &str or &[u8].

    Added Parser::parse_ methods for the remaining integer types (u8, u16, u32, i8, i16, i32)

    Added "parsing_no_proc" cargo feature, to enable all parser items except for those that require using the konst_proc_macro crate.

    Fixed eq_bytes and cmp_bytes doc examples

    Fixed the lack of indicators that the rebind_if_ok and try_rebind macros require the "parsing_no_proc" feature.

    Open source →
  43. 0.2.0 23 Mar 2021
    Release notes

    Breaking change: tightened the syntax of the parse_any macro, now it requires the last branch in the match-like syntax to be _ => <expression>, forbidding _ patterns in other branches.

    Added support for these Parser methods in parse_any:

    • find_skip - rfind_skip - trim_start_matches - trim_end_matches

    Moved these functions from slice::cmp to slice, and reexported back in slice::cmp:

    • cmp_slice_u8: renamed to cmp_bytes
    • eq_slice_u8: renamed to eq_bytes
    • cmp_option_slice_u8: renamed to cmp_option_bytes
    • eq_option_slice_u8: renamed to eq_option_bytes The above *_bytes functions do not require any cargo features to use.

    Added comparison functions for &[usize], &[isize], Option<&[usize]>, Option<&[isize]>

    0.1

    Open source →
  44. 0.1.1 22 Mar 2021

    Nothing published for this version

  45. 0.1.0 22 Mar 2021
    Release notes

    Defined the konst_proc_macros crate 0.1.0, for internal use by konst.

    Defined equality and ordering comparison functions for:

    • All the primitive types, including integers, bool, char, and Options of them, inside the primitives::cmp module.

    • Ranges and RangeInclusives of all unsigned integer types, inside the range::cmp module.

    • All the NonZero* types, and Option<NonZero*> types, inside the nonzero::cmp module.

    • &str and Option<&str>, inside the string module.

    • Ordering, Option<Ordering>, PhantomData<T>, PhantomPinned, inside the other::cmp module.

    • Slices of integers, &[bool], &[char], &[&str], &[&[u8]], and Options of them, inside the slice::cmp module.

    Defined the polymorphism module, to do type-based overloading, currently limited to const_eq and const_cmp methods.

    Defined these items in the polymorphism module:

    • CmpWrapper: Wrapper type which implements many methods for std types, currently only const_eq and const_cmp.

    • ConstCmpMarker: Trait for describing whether a type is from the standard library, and has const_eq and/or const_cmp methods.

    • IsAConstCmpMarker: Helper type used to automatically coerce standard library types into CmpWrapper, and leaving non-std ones unwrapped.

    • IsArrayKind, IsNotStdKind, IsStdKind: for describing the kind of type something is.

    Declared these functions in the slice module: bytes_contain, bytes_end_with , bytes_find , bytes_rcontain , bytes_rfind , bytes_start_with, bytes_strip_prefix , bytes_strip_suffix , slice_from , slice_range , slice_up_to , split_at.

    Declared these functions in the string module: str_contains, str_ends_with, str_find, str_rcontains, str_rfind, str_starts_with

    Declared the parsing module with:

    • Parser: A parser constructible from &[u8] or &str.

    • ParseError: The error type returned by fallible Parser methods.

    • ErrorKind: Enum for the kinds of parsing errors that happened, included inside ParseError

    • ParseDirection: Enum for the direction a parser is currently parsing from, either the end or the start.

    • ParseValueResult: Type alias for the Result types that Parser returns when parsing types.

    • ParserResult: Type alias for Result<'a, Parser, ParseError>

    Reexporting these types in the root module:

    parsing::{Parser}
    string::{cmp_str, eq_str, cmp_option_str, eq_option_str},
    

    Declared these macros:

    • coerce_to_cmp: For coercing values to types with const_eq or const_cmp methods.

    • const_cmp, const_cmp_for, const_eq, const_eq_for: for comparing values

    • for_range: for iterating over a range.

    • impl_cmp: For implementing ConstCmpMarker for multiple types, and declaring const_eq/const_cmp.

    • konst: For emulating inline const (const{ }).

    • parse_any: For calling Parser methods with multiple alternative string literal patterns.

    • rebind_if_ok: if let Ok which rebinds variables instead of shadowing them.

    • try_equal: For returning early when an ordering isn't Ordering::Equal

    • try_rebind: For returning early on Err, rebinding variables on Ok.

    • unwrap_ctx: Unwraps a Result, calling .panic() on the error value on error.

    • unwrap_opt_or: Const-equivalent of Option::unwrap_or and Option::unwrap_or_else.

    • unwrap_res_or: Const-equivalent of Result::unwrap_or and Result::unwrap_or_else.

    Defined these cargo features:

    • "cmp"(enabled by default): Enables all the comparison functions and macros.

    • "parsing"(enabled by default): Enables the parsing module, macros, and compiles the konst_proc_macros crate.

    • "constant_time_slice": Improves the performance of certain slice functions from taking linear time to constant time. Requires Rust nightly.

    • "const_generics": Enables impls that use const generics, instead of being implemented for small arrays. Requires Rust 1.51.0 .

    Open source →
  46. 0.0.0 15 Mar 2021 withdrawn

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive