Skip to content

Commit 0d31a1c

Browse files
committed
Rename Error::MemoryLimitNotAvailable to Error::MemoryControlNotAvailable
1 parent 3dc58cd commit 0d31a1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/error.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ pub enum Error {
4242
GarbageCollectorError(StdString),
4343
/// Potentially unsafe action in safe mode.
4444
SafetyError(StdString),
45-
/// Setting memory limit is not available.
45+
/// Memory control is not available.
4646
///
4747
/// This error can only happen when Lua state was not created by us and does not have the
4848
/// custom allocator attached.
49-
MemoryLimitNotAvailable,
49+
MemoryControlNotAvailable,
5050
/// A mutable callback has triggered Lua code that has called the same mutable callback again.
5151
///
5252
/// This is an error because a mutable callback can only be borrowed mutably once.
@@ -220,8 +220,8 @@ impl fmt::Display for Error {
220220
Error::SafetyError(msg) => {
221221
write!(fmt, "safety error: {msg}")
222222
},
223-
Error::MemoryLimitNotAvailable => {
224-
write!(fmt, "setting memory limit is not available")
223+
Error::MemoryControlNotAvailable => {
224+
write!(fmt, "memory control is not available")
225225
}
226226
Error::RecursiveMutCallback => write!(fmt, "mutable callback called recursively"),
227227
Error::CallbackDestructed => write!(

src/state.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ impl Lua {
792792
unsafe {
793793
match MemoryState::get(lua.main_state) {
794794
mem_state if !mem_state.is_null() => Ok((*mem_state).set_memory_limit(limit)),
795-
_ => Err(Error::MemoryLimitNotAvailable),
795+
_ => Err(Error::MemoryControlNotAvailable),
796796
}
797797
}
798798
}

0 commit comments

Comments
 (0)