aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-06 16:27:37 +0200
committerKim Alvefur <zash@zash.se>2023-04-06 16:27:37 +0200
commita8a7be217a12b49d3530ae83ff1bb818dfab134b (patch)
tree82296b35d4499c3a7415d9bf5772d44213d0e69c /util
parent7e50781f519fcad5c33b570e1996a8026841adc3 (diff)
downloadprosody-a8a7be217a12b49d3530ae83ff1bb818dfab134b.tar.gz
prosody-a8a7be217a12b49d3530ae83ff1bb818dfab134b.zip
util.array: Change tostring format to [a,b,c]
Arrays in Lua do use { } but since __tostring is often user-facing it seems sensible to use [ ] instead for consistency with many other systems; as well as to allow the {a,b,c} formatting to be used by util.set without being confused with util.array.
Diffstat (limited to 'util')
-rw-r--r--util/array.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/array.lua b/util/array.lua
index 78c076d0..fd8dd8be 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -24,7 +24,7 @@ local array_methods = {};
local array_mt = {
__index = array_methods;
__name = "array";
- __tostring = function (self) return "{"..self:concat(", ").."}"; end;
+ __tostring = function (self) return "["..self:concat(", ").."]"; end;
};
function array_mt:__freeze() return self; end