Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sliceiter #304

Merged
merged 4 commits into from
Oct 20, 2021
Merged

Remove sliceiter #304

merged 4 commits into from
Oct 20, 2021

Conversation

andy-thomason
Copy link
Contributor

This PR removes SliceIter and replaces Real and Int with Doubles and Integers.

@andy-thomason andy-thomason linked an issue Oct 13, 2021 that may be closed by this pull request
pub fn as_real_iter(&self) -> Option<Real> {
self.as_real_slice()
.map(|slice| Real::from_slice(self.to_owned(), slice))
pub fn as_real_iter(&self) -> Option<impl Iterator<Item = &f64>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect to have here <Item = &Rfloat>, similar to as_logical_iter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Another PR, though.

@Ilia-Kosenkov
Copy link
Member

I had conflicts with these

impl ToVectorValue for Bool {
fn sexptype() -> SEXPTYPE {
LGLSXP
}
fn to_logical(&self) -> i32
where
Self: Sized,
{
self.0
}
}
impl ToVectorValue for &Bool {
fn sexptype() -> SEXPTYPE {
LGLSXP
}
fn to_logical(&self) -> i32
where
Self: Sized,
{
self.0
}
}

And then I think here
fn fixed_size_collect<I>(iter: I, len: usize) -> Robj
where
I: Iterator,
I: Sized,
I::Item: ToVectorValue,

Will ToVectorValue remain in the codebase or is it subject to retirement?

@andy-thomason
Copy link
Contributor Author

I'm inclined to retire ToVectorValue in due course. It is doing a lot of work at the moment.

There are changes coming to the language that will allow better specialisation of traits.
Don't hold your breath, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SliceIter is obsolete
2 participants