From 0d31a1caa65382492c52a1e855f379fee67dbd64 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Tue, 22 Oct 2024 22:44:52 +0100 Subject: [PATCH] Rename `Error::MemoryLimitNotAvailable` to `Error::MemoryControlNotAvailable` --- src/error.rs | 8 ++++---- src/state.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/error.rs b/src/error.rs index db4d479d..fa61edac 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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. @@ -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!( diff --git a/src/state.rs b/src/state.rs index 5188bfdf..096798b0 100644 --- a/src/state.rs +++ b/src/state.rs @@ -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), } } }