Skip to content

Commit 2f5b081

Browse files
committed
Loosen lifetime restrictions on slices
1 parent 8b46dab commit 2f5b081

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/lib.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ extern crate postgres;
66
extern crate byteorder;
77

88
use std::mem;
9-
use std::slice;
10-
use std::vec;
119

1210
#[doc(inline)]
1311
pub use base::ArrayBase;
@@ -81,14 +79,14 @@ trait InternalMutableArray<T>: MutableArray<T> {
8179
fn raw_get_mut<'a>(&'a mut self, idx: usize, size: usize) -> &'a mut T;
8280
}
8381

84-
enum ArrayParent<'parent, T:'static> {
85-
Slice(&'parent ArraySlice<'static, T>),
86-
MutSlice(&'parent MutArraySlice<'static, T>),
82+
enum ArrayParent<'parent, T:'parent> {
83+
Slice(&'parent ArraySlice<'parent, T>),
84+
MutSlice(&'parent MutArraySlice<'parent, T>),
8785
Base(&'parent ArrayBase<T>),
8886
}
8987

9088
/// An immutable slice of a multi-dimensional array
91-
pub struct ArraySlice<'parent, T:'static> {
89+
pub struct ArraySlice<'parent, T:'parent> {
9290
parent: ArrayParent<'parent, T>,
9391
idx: usize,
9492
}
@@ -133,13 +131,13 @@ impl<'parent, T> InternalArray<T> for ArraySlice<'parent, T> {
133131
}
134132
}
135133

136-
enum MutArrayParent<'parent, T:'static> {
137-
Slice(&'parent mut MutArraySlice<'static, T>),
134+
enum MutArrayParent<'parent, T:'parent> {
135+
Slice(&'parent mut MutArraySlice<'parent, T>),
138136
Base(&'parent mut ArrayBase<T>),
139137
}
140138

141139
/// A mutable slice of a multi-dimensional array
142-
pub struct MutArraySlice<'parent, T:'static> {
140+
pub struct MutArraySlice<'parent, T:'parent> {
143141
parent: MutArrayParent<'parent, T>,
144142
idx: usize,
145143
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy