There is a impl From<E: Element> for Handle implemented (which allows Handle::from(elem) and at most elem.into()) to allow a conversion between specialized objects to a basic elemental handle and there's also a pub fn from_element<E: Element>(elem: E) -> Handle implemented as a constructor of the Handle object.
Should the from_element constructor be removed in favor of From trait?
Note there are other from-like methods in the Element trait (Handle is also a Element), those shouldn't be removed but it's good to think they exist in relation to from_element:
There is a
impl From<E: Element> for Handle
implemented (which allowsHandle::from(elem)
and at mostelem.into()
) to allow a conversion between specialized objects to a basic elemental handle and there's also apub fn from_element<E: Element>(elem: E) -> Handle
implemented as a constructor of theHandle
object.Should the
from_element
constructor be removed in favor ofFrom
trait?Note there are other from-like methods in the Element trait (Handle is also a Element), those shouldn't be removed but it's good to think they exist in relation to
from_element
:fn from_handle(handle: Handle) -> Result<Self, Handle>
unsafe fn from_raw_unchecked(ih: *mut iup_sys::Ihandle) -> Self
fn from_raw(ih: *mut iup_sys::Ihandle) -> Self