Skip to content

Commit 1b500b7

Browse files
committed
Remove generic from internal definition of RawLua::create_string
1 parent ce4fc80 commit 1b500b7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

src/state/raw.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)