diff --git a/src/function_source.rs b/src/function_source.rs index 2f98787e3..bd87cbc4d 100644 --- a/src/function_source.rs +++ b/src/function_source.rs @@ -105,19 +105,17 @@ impl Source for FunctionSource { conn.query_one(&prep_query, &[&xyz.z, &xyz.x, &xyz.y]) }; - let tile = tile - .map(|row| row.get("tile")) - .map_err(|error| { - prettify_error!( - error, - r#"Can't get "{}" tile at /{}/{}/{} with {:?} params"#, - self.id, - xyz.z, - xyz.x, - xyz.z, - query_to_json(query) - ) - })?; + let tile = tile.map(|row| row.get("tile")).map_err(|error| { + prettify_error!( + error, + r#"Can't get "{}" tile at /{}/{}/{} with {:?} params"#, + self.id, + xyz.z, + xyz.x, + xyz.z, + query_to_json(query) + ) + })?; Ok(tile) } @@ -140,7 +138,8 @@ pub fn get_function_sources(conn: &mut Connection) -> Result { - match output_names.get(0) { - Some(Value::String(name)) => { - let name = escape_identifier(name); - sql = format!("({sql}).{name}");}, - _ => unreachable!("output_names[0] is not a string"), + Value::Array(output_names) => match output_names.get(0) { + Some(Value::String(name)) => { + let name = escape_identifier(name); + sql = format!("({sql}).{name}"); } - } + _ => unreachable!("output_names[0] is not a string"), + }, _ => unreachable!("output_names is not an array"), } }