File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1180,7 +1180,7 @@ impl Lua {
11801180 /// and `&String`, you can also pass plain `&[u8]` here.
11811181 #[ inline]
11821182 pub fn create_string ( & self , s : impl AsRef < [ u8 ] > ) -> Result < String > {
1183- unsafe { self . lock ( ) . create_string ( s) }
1183+ unsafe { self . lock ( ) . create_string ( s. as_ref ( ) ) }
11841184 }
11851185
11861186 /// Creates and returns a Luau [buffer] object from a byte slice of data.
Original file line number Diff line number Diff line change @@ -510,16 +510,16 @@ impl RawLua {
510510 }
511511
512512 /// See [`Lua::create_string`]
513- pub ( crate ) unsafe fn create_string ( & self , s : impl AsRef < [ u8 ] > ) -> Result < String > {
513+ pub ( crate ) unsafe fn create_string ( & self , s : & [ u8 ] ) -> Result < String > {
514514 let state = self . state ( ) ;
515515 if self . unlikely_memory_error ( ) {
516- push_string ( state, s. as_ref ( ) , false ) ?;
516+ push_string ( state, s, false ) ?;
517517 return Ok ( String ( self . pop_ref ( ) ) ) ;
518518 }
519519
520520 let _sg = StackGuard :: new ( state) ;
521521 check_stack ( state, 3 ) ?;
522- push_string ( state, s. as_ref ( ) , true ) ?;
522+ push_string ( state, s, true ) ?;
523523 Ok ( String ( self . pop_ref ( ) ) )
524524 }
525525
You can’t perform that action at this time.
0 commit comments