@@ -142,7 +142,7 @@ struct PreparedData {
142142/// fn shape(&self) -> &[usize]{
143143/// &self.shape
144144/// }
145- /// fn data(&self) -> Cow<[u8]>{
145+ /// fn data(&self) -> Cow<'_, [u8]>{
146146/// (&self.data).into()
147147/// }
148148/// fn data_len(&self) -> usize{
@@ -166,7 +166,7 @@ struct PreparedData {
166166/// fn shape(&self) -> &[usize]{
167167/// &self.shape
168168/// }
169- /// fn data(&self) -> Cow<[u8]>{
169+ /// fn data(&self) -> Cow<'_, [u8]>{
170170/// self.data.into()
171171/// }
172172/// fn data_len(&self) -> usize{
@@ -193,7 +193,7 @@ struct PreparedData {
193193/// fn shape(&self) -> &[usize]{
194194/// &self.shape
195195/// }
196- /// fn data(&self) -> Cow<[u8]>{
196+ /// fn data(&self) -> Cow<'_, [u8]>{
197197/// // This copies data from GPU to CPU.
198198/// let data: Vec<u8> = self.data.to_vec();
199199/// data.into()
@@ -211,7 +211,7 @@ pub trait View {
211211 /// The shape of the tensor
212212 fn shape ( & self ) -> & [ usize ] ;
213213 /// The data of the tensor
214- fn data ( & self ) -> Cow < [ u8 ] > ;
214+ fn data ( & self ) -> Cow < ' _ , [ u8 ] > ;
215215 /// The length of the data, in bytes.
216216 /// This is necessary as this might be faster to get than `data().len()`
217217 /// for instance for tensors residing in GPU.
@@ -678,7 +678,7 @@ impl View for &TensorView<'_> {
678678 & self . shape
679679 }
680680
681- fn data ( & self ) -> Cow < [ u8 ] > {
681+ fn data ( & self ) -> Cow < ' _ , [ u8 ] > {
682682 self . data . into ( )
683683 }
684684
@@ -696,7 +696,7 @@ impl View for TensorView<'_> {
696696 & self . shape
697697 }
698698
699- fn data ( & self ) -> Cow < [ u8 ] > {
699+ fn data ( & self ) -> Cow < ' _ , [ u8 ] > {
700700 self . data . into ( )
701701 }
702702
0 commit comments