aboutsummaryrefslogtreecommitdiffstats
path: root/util/rsm.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-23 18:42:47 +0200
committerKim Alvefur <zash@zash.se>2020-04-23 18:42:47 +0200
commit4d54d3e1352e11519002d917f4d24267d0776bd7 (patch)
tree8d023f439b0c0005d3be4af469374d6163d46874 /util/rsm.lua
parentf4572c17325ceab3d69a137f2bc508c33638cc94 (diff)
downloadprosody-4d54d3e1352e11519002d917f4d24267d0776bd7.tar.gz
prosody-4d54d3e1352e11519002d917f4d24267d0776bd7.zip
util.rsm: Don't convert values to strings that should already be strings
Causes util.stanza to throw an error, which helps detect mistakes
Diffstat (limited to 'util/rsm.lua')
-rw-r--r--util/rsm.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/rsm.lua b/util/rsm.lua
index aade3c19..ad725d76 100644
--- a/util/rsm.lua
+++ b/util/rsm.lua
@@ -10,7 +10,7 @@
--
local stanza = require"util.stanza".stanza;
-local tostring, tonumber = tostring, tonumber;
+local tonumber = tonumber;
local s_format = string.format;
local type = type;
local pairs = pairs;
@@ -52,14 +52,14 @@ local element_generators = setmetatable({
if type(data) == "table" then
st:tag("first", { index = inttostr(data.index) }):text(data[1]):up();
else
- st:tag("first"):text(tostring(data)):up();
+ st:tag("first"):text(data):up();
end
end;
before = function(st, data)
if data == true then
st:tag("before"):up();
else
- st:tag("before"):text(tostring(data)):up();
+ st:tag("before"):text(data):up();
end
end;
max = function (st, data)
@@ -71,7 +71,7 @@ local element_generators = setmetatable({
}, {
__index = function(_, name)
return function(st, data)
- st:tag(name):text(tostring(data)):up();
+ st:tag(name):text(data):up();
end
end;
});