Skip to content

Slicing an ArrayView restricts lifetime #988

@cassiersg

Description

@cassiersg

The following doesn't work, due to the signature of ArrayBase::slice.

fn foo<'a>(x: ArrayView1<'a, i32>) -> ArrayView<'a, i32> {
    x.slice(s![1..])
}

It would be nice to have a method dedicated to this on ArrayView, similarly to ArrayView::to_slice, (which is a taylor-adapted version of ArrayBase::as_slice).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions