From f7ee18076a225f3371f33397344cb0fea790b842 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 26 Oct 2023 20:16:45 -0700 Subject: [PATCH] iter wrong code but it has no red squiggle --- src/zeroes.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/zeroes.rs b/src/zeroes.rs index 67c5c75..30a59b9 100644 --- a/src/zeroes.rs +++ b/src/zeroes.rs @@ -2,31 +2,31 @@ use crate::integer::Planar64; #[inline] -pub fn zeroes2<'a>(a0:Planar64,a1:Planar64,a2:Planar64)->&'a [Planar64]{ - if a2==Planar64::ZERO{ - return zeroes1(a0,a1); - } +pub fn zeroes2(a0:Planar64,a1:Planar64,a2:Planar64)->impl std::iter::IntoIterator{ + // if a2==Planar64::ZERO{ + // return zeroes1(a0,a1); + // } let radicand=a1.get() as i128*a1.get() as i128-a2.get() as i128*a0.get() as i128*4; if 0(a0:Planar64,a1:Planar64)->&'a [Planar64]{ +pub fn zeroes1(a0:Planar64,a1:Planar64)->impl std::iter::IntoIterator{ if a1==Planar64::ZERO{ - &[] + return [Planar64::ZERO].into_iter(); }else{ - [-a0/a1].as_slice() + return [-a0/a1].into_iter(); } } \ No newline at end of file