Skip to content

Commit da0b686

Browse files
committed
Fix docs link and format for CI
1 parent c615f45 commit da0b686

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/impl_views/conversions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ where D: Dimension
275275
{
276276
/// Convert into a read-only view.
277277
///
278-
/// Unlike [`Self::view`], this method consumes the mutable view and preserves
279-
/// the original lifetime of the data.
278+
/// This method consumes the mutable view and returns an `ArrayView` that
279+
/// preserves the original lifetime `'a` of the data.
280280
pub fn into_view(self) -> ArrayView<'a, A, D>
281281
{
282282
unsafe { ArrayView::new(self.parts.ptr, self.parts.dim, self.parts.strides) }

tests/views.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ fn test_view_conversion()
3333
fn test_view_conversion_lifetime()
3434
{
3535
// Regression test for #1595
36-
struct Foo<'a> {
36+
struct Foo<'a>
37+
{
3738
data: ArrayViewMut2<'a, f32>,
3839
}
3940

40-
impl<'a> Foo<'a> {
41-
fn into_shared(self) -> ArrayView2<'a, f32> {
41+
impl<'a> Foo<'a>
42+
{
43+
fn into_shared(self) -> ArrayView2<'a, f32>
44+
{
4245
self.data.into_view()
4346
}
4447

45-
fn into_shared_from(self) -> ArrayView2<'a, f32> {
48+
fn into_shared_from(self) -> ArrayView2<'a, f32>
49+
{
4650
self.data.into()
4751
}
4852
}

0 commit comments

Comments
 (0)