Skip to content

Commit

Permalink
Text
Browse files Browse the repository at this point in the history
  • Loading branch information
RoDmitry committed Dec 28, 2023
1 parent 522e7af commit f91646a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This crate has the following features:

- `derive` (default): Enables the derive macro for the `Merge` trait using the
`merge_derive` crate.
- `num` (default): Enables the merge strategies in the `num` module that
- `num`: Enables the merge strategies in the `num` module that
require the `num_traits` crate.
- `std` (default): Enables the merge strategies for the `hashmap` and `vec`
that require the standard library. If this feature is not set,
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//!
//! - `derive` (default): Enables the derive macro for the `Merge` trait using the `merge_derive`
//! crate.
//! - `num` (default): Enables the merge strategies in the `num` module that require the
//! - `num`: Enables the merge strategies in the `num` module that require the
//! `num_traits` crate.
//! - `std` (default): Enables the merge strategies in the `hashmap` and `vec` modules that require
//! the standard library. If this feature is not set, `merge2` is a `no_std`.
Expand Down Expand Up @@ -153,9 +153,10 @@ pub trait Merge: Sized {
fn merge(&mut self, other: &mut Self);
}

// Merge strategies applicable to any types
/// Merge strategies applicable to any types
pub mod any {
/// Overwrite `left` with `right` regardless of their values. Sets `right` to a Default value.
/// Swap would be faster, if you don't need default.
#[inline]
pub fn overwrite<T: Default>(left: &mut T, right: &mut T) {
*left = core::mem::take(right);
Expand Down

0 comments on commit f91646a

Please sign in to comment.