From 7721cb9f07e765c2a77ed4b1de3fc257cf364f9c Mon Sep 17 00:00:00 2001 From: Chris <1731074+ccbrown@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:23:36 -0500 Subject: [PATCH] fix: rename extend function to avoid std conflicts (#46) --- packages/iocraft/src/element.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/iocraft/src/element.rs b/packages/iocraft/src/element.rs index 6e83b1e..aecc946 100644 --- a/packages/iocraft/src/element.rs +++ b/packages/iocraft/src/element.rs @@ -18,7 +18,7 @@ use std::{ /// Used by the `element!` macro to extend a collection with elements. #[doc(hidden)] pub trait ExtendWithElements: Sized { - fn extend>(self, dest: &mut E); + fn extend_with_elements>(self, dest: &mut E); } impl<'a, T, U> ExtendWithElements for Element<'a, U> @@ -26,13 +26,13 @@ where U: ElementType + 'a, T: From>, { - fn extend>(self, dest: &mut E) { + fn extend_with_elements>(self, dest: &mut E) { dest.extend([self.into()]); } } impl<'a> ExtendWithElements> for AnyElement<'a> { - fn extend>>(self, dest: &mut E) { + fn extend_with_elements>>(self, dest: &mut E) { dest.extend([self]); } } @@ -42,7 +42,7 @@ where I: IntoIterator, U: Into, { - fn extend>(self, dest: &mut E) { + fn extend_with_elements>(self, dest: &mut E) { dest.extend(self.into_iter().map(|e| e.into())); } } @@ -54,7 +54,7 @@ where T: Extend, U: ExtendWithElements, { - elements.extend(dest); + elements.extend_with_elements(dest); } /// Used to identify an element within the scope of its parent. This is used to minimize the number