Skip to content

Commit

Permalink
馃毃 simplify lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Jan 10, 2024
1 parent fe14484 commit 4e2a20b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/json_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ fn json_query<T: Serialize, E: AsRef<str>>(expr: E, data: T) -> Result<Json, Jso
})
}

fn find_data_format<'reg>(h: &Helper<'reg>) -> Result<DataFormat, RenderError> {
fn find_data_format(h: &Helper) -> Result<DataFormat, RenderError> {
let param = h
.hash_get("format")
.and_then(|v| v.value().as_str())
.unwrap_or("json");
DataFormat::from_str(param).map_err(crate::to_nested_error)
}

fn find_str_param<'reg>(pos: usize, h: &Helper<'reg>) -> Result<String, RenderError> {
fn find_str_param(pos: usize, h: &Helper) -> Result<String, RenderError> {
h.param(pos)
.ok_or_else(|| crate::to_other_error(format!("param {} (the string) not found", pos)))
// .and_then(|v| {
Expand Down

0 comments on commit 4e2a20b

Please sign in to comment.