From 14978069896e87083fd46795cc26b2f58b24828f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Oct 2018 12:54:57 +0200 Subject: util.serialization: Rename non-fatal fallback handler for clarity --- util/serialization.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util') diff --git a/util/serialization.lua b/util/serialization.lua index 52e89136..8ef8048d 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -38,7 +38,7 @@ local function fatal_error(obj, why) error("Can't serialize "..type(obj) .. (why and ": ".. why or "")); end -local function default_fallback(x, why) +local function nonfatal_fallback(x, why) return s_format("nil --[[%s: %s]]", type(x), why or "fail"); end @@ -84,7 +84,7 @@ local function new(opt) opt.preset = "oneline"; opt.freeze = true; opt.fatal = false; - opt.fallback = default_fallback; + opt.fallback = nonfatal_fallback; opt.unquoted = true; end if opt.preset == "oneline" then @@ -100,7 +100,7 @@ local function new(opt) opt.unquoted = true; end - local fallback = opt.fallback or opt.fatal == false and default_fallback or fatal_error; + local fallback = opt.fallback or opt.fatal == false and nonfatal_fallback or fatal_error; local function ser(v) return (types[type(v)] or fallback)(v); -- cgit v1.2.3