Skip to content

Commit

Permalink
chore(template): remove deprecated usage of json_pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Jun 20, 2023
1 parent 39cba74 commit 7266575
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
60 changes: 35 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ clap_complete_nushell = { version = "0.1.8", optional = true }
conventional_commit_parser = "0.9.4"
pest = "2.1.3"
pest_derive = "2.1.0"
tera = "1.15.0"
tera = "1.18.1"
globset = "0.4.8"
log = "0.4.16"
stderrlog = "0.5.1"
Expand Down
6 changes: 2 additions & 4 deletions src/conventional/changelog/renderer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use tera::{get_json_pointer, to_value, try_get_value, Context, Tera, Value};
use tera::{dotted_pointer, to_value, try_get_value, Context, Tera, Value};

use crate::conventional::changelog::release::Release;
use crate::conventional::changelog::template::{
Expand Down Expand Up @@ -95,12 +95,10 @@ impl Renderer {

let value = args.get("value").unwrap_or(&Value::Null);

let json_pointer = get_json_pointer("scope");

arr = arr
.into_iter()
.filter(|v| {
let val = v.pointer(&json_pointer).unwrap_or(&Value::Null);
let val = dotted_pointer(v, "scope").unwrap_or(&Value::Null);
if value.is_null() {
val == value
} else {
Expand Down

0 comments on commit 7266575

Please sign in to comment.