aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/factoids/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/factoids/utils.rs')
-rw-r--r--src/plugins/factoids/utils.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/factoids/utils.rs b/src/plugins/factoids/utils.rs
index 9352a43..a7bf04a 100644
--- a/src/plugins/factoids/utils.rs
+++ b/src/plugins/factoids/utils.rs
@@ -38,7 +38,9 @@ pub fn download(_: &Lua, url: String) -> Result<String, LuaError> {
fn convert_value(lua: &Lua, sval: SerdeValue, max_recurs: usize) -> Result<LuaValue, LuaError> {
if max_recurs == 0 {
- return Err(RuntimeError(String::from("Reached max recursion level - json is nested too deep")));
+ return Err(RuntimeError(String::from(
+ "Reached max recursion level - json is nested too deep",
+ )));
}
let lval = match sval {
@@ -46,7 +48,9 @@ fn convert_value(lua: &Lua, sval: SerdeValue, max_recurs: usize) -> Result<LuaVa
SerdeValue::Bool(b) => LuaValue::Boolean(b),
SerdeValue::String(s) => LuaValue::String(lua.create_string(&s)?),
SerdeValue::Number(n) => {
- let f = n.as_f64().ok_or(RuntimeError(String::from("Failed to convert number into double",)))?;
+ let f = n.as_f64().ok_or(RuntimeError(String::from(
+ "Failed to convert number into double",
+ )))?;
LuaValue::Number(f)
}
SerdeValue::Array(arr) => {