File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ impl ::Device for GlDevice {
400
400
:: BufferHandle :: from_raw ( :: Handle ( name, info) )
401
401
}
402
402
403
- fn create_buffer_static < T > ( & mut self , data : & :: Blob < T > ) -> :: BufferHandle < T > {
403
+ fn create_buffer_static < ' a , T > ( & mut self , data : & :: Blob < T > + ' a ) -> :: BufferHandle < T > {
404
404
let name = self . create_buffer_internal ( ) ;
405
405
let info = :: BufferInfo {
406
406
usage : :: UsageStatic ,
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ pub trait Blob<T> {
179
179
/// Helper trait for casting &Blob
180
180
pub trait RefBlobCast < ' a > {
181
181
/// Cast the type the blob references
182
- fn cast < U > ( self ) -> & ' a Blob < U > ;
182
+ fn cast < U > ( self ) -> & ' a Blob < U > + ' a ;
183
183
}
184
184
185
185
/// Helper trait for casting Box<Blob>
@@ -188,8 +188,8 @@ pub trait BoxBlobCast {
188
188
fn cast < U > ( self ) -> Box < Blob < U > + Send > ;
189
189
}
190
190
191
- impl < ' a , T > RefBlobCast < ' a > for & ' a Blob < T > {
192
- fn cast < U > ( self ) -> & ' a Blob < U > {
191
+ impl < ' a , T > RefBlobCast < ' a > for & ' a Blob < T > + ' a {
192
+ fn cast < U > ( self ) -> & ' a Blob < U > + ' a {
193
193
unsafe { std:: mem:: transmute ( self ) }
194
194
}
195
195
}
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ fn main() {
172
172
] ;
173
173
174
174
let slice = {
175
- let buf = device. create_buffer_static ( & index_data) ;
175
+ let buf = device. create_buffer_static ( & index_data. as_slice ( ) ) ;
176
176
gfx:: IndexSlice8 ( gfx:: TriangleList , buf, 0 , 36 )
177
177
} ;
178
178
@@ -187,7 +187,7 @@ fn main() {
187
187
let image_info = texture_info. to_image_info ( ) ;
188
188
let texture = device. create_texture ( texture_info) . unwrap ( ) ;
189
189
device. update_texture ( & texture, & image_info,
190
- & vec ! [ 0x20u8 , 0xA0u8 , 0xC0u8 , 0x00u8 ] )
190
+ & vec ! [ 0x20u8 , 0xA0u8 , 0xC0u8 , 0x00u8 ] . as_slice ( ) )
191
191
. unwrap ( ) ;
192
192
193
193
let sampler = device. create_sampler (
You can’t perform that action at this time.
0 commit comments