~ireas/public-inbox

merge-rs: Allow overwritting of any value v1 PROPOSED

Eclextic: 1
 Allow overwritting of any value

 1 files changed, 8 insertions(+), 0 deletions(-)
#1096955 archlinux-msrv.yml failed
#1096956 archlinux.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~ireas/public-inbox/patches/46820/mbox | git am -3
Learn more about email & git

[PATCH merge-rs] Allow overwritting of any value Export this patch

---
 src/lib.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/lib.rs b/src/lib.rs
index ab9b4ab..f70628e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -161,6 +161,14 @@ pub trait Merge {
    fn merge(&mut self, other: Self);
}

// Merge strategies applicable to any type
pub mod any {
    /// Overwrite `left` with `right` regardless of their values.
    pub fn overwrite_none<T>(left: &mut T, right: T) {
        *left = right;
    }
}

/// Merge strategies for `Option`
pub mod option {
    /// Overwrite `left` with `right` only if `left` is `None`.
-- 
2.42.1
merge-rs/patches: FAILED in 6m42s

[Allow overwritting of any value][0] from [Eclextic][1]

[0]: https://lists.sr.ht/~ireas/public-inbox/patches/46820
[1]: mailto:eclexticdev@gmail.com

✗ #1096955 FAILED merge-rs/patches/archlinux-msrv.yml https://builds.sr.ht/~ireas/job/1096955
✗ #1096956 FAILED merge-rs/patches/archlinux.yml      https://builds.sr.ht/~ireas/job/1096956