Skip to content

Commit

Permalink
Rename Error::MemoryLimitNotAvailable to `Error::MemoryControlNotAv…
Browse files Browse the repository at this point in the history
…ailable`
  • Loading branch information
khvzak committed Oct 22, 2024
1 parent 3dc58cd commit 0d31a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ pub enum Error {
GarbageCollectorError(StdString),
/// Potentially unsafe action in safe mode.
SafetyError(StdString),
/// Setting memory limit is not available.
/// Memory control is not available.
///
/// This error can only happen when Lua state was not created by us and does not have the
/// custom allocator attached.
MemoryLimitNotAvailable,
MemoryControlNotAvailable,
/// A mutable callback has triggered Lua code that has called the same mutable callback again.
///
/// This is an error because a mutable callback can only be borrowed mutably once.
Expand Down Expand Up @@ -220,8 +220,8 @@ impl fmt::Display for Error {
Error::SafetyError(msg) => {
write!(fmt, "safety error: {msg}")
},
Error::MemoryLimitNotAvailable => {
write!(fmt, "setting memory limit is not available")
Error::MemoryControlNotAvailable => {
write!(fmt, "memory control is not available")
}
Error::RecursiveMutCallback => write!(fmt, "mutable callback called recursively"),
Error::CallbackDestructed => write!(
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ impl Lua {
unsafe {
match MemoryState::get(lua.main_state) {
mem_state if !mem_state.is_null() => Ok((*mem_state).set_memory_limit(limit)),
_ => Err(Error::MemoryLimitNotAvailable),
_ => Err(Error::MemoryControlNotAvailable),
}
}
}
Expand Down

0 comments on commit 0d31a1c

Please sign in to comment.