Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cargo-deny-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- bans licenses sources

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v5
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}
4 changes: 2 additions & 2 deletions .github/workflows/cargo-deny-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v5
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
include:
- build: msrv
os: ubuntu-latest
rust: 1.70.0
rust: 1.85.0
- build: stable
os: ubuntu-latest
rust: stable
Expand All @@ -26,10 +26,10 @@ jobs:
os: macOS-latest
rust: stable
- build: win-msvc
os: windows-2019
os: windows-2022
rust: stable
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -47,7 +47,7 @@ jobs:
name: wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.0.0
uses: actions/checkout@v5
- name: build_and_deploy
uses: shalzz/zola-deploy-action@v0.17.2
env:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords = ["template", "html", "django", "markup", "jinja2"]
categories = ["template-engine"]
edition = "2018"
include = ["/src/**/*", "/LICENSE", "/README.md", "/CHANGELOG.md"]
rust-version = "1.70"
rust-version = "1.85"

[dependencies]
globwalk = "0.9.1"
Expand All @@ -23,7 +23,7 @@ lazy_static = "1.4"
# used in striptags, spaceless & titles filters. Already pulled by globwalk
regex = "1.7"
# used in truncate filter and string iteration
unic-segment = "0.9"
unicode-segmentation = "1.12"

# used in slugify filter
slug = {version = "0.1", optional = true}
Expand Down
35 changes: 3 additions & 32 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
# this list would mean the nix crate, as well as any of its exclusive
# dependencies not shared by any other crates, would be ignored, as the target
# list here is effectively saying which targets you are building for.
targets = [
# targets = [
# The triple can be any string, but only the target triples built in to
# rustc (as of 1.40) can be checked against actual config expressions
#{ triple = "x86_64-unknown-linux-musl" },
# You can also specify which target_features you promise are enabled for a
# particular target. target_features are currently not validated against
# the actual valid features supported by the target architecture.
#{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
]
# ]

# This section is considered when running `cargo deny check advisories`
# More documentation for the advisories section can be found here:
Expand All @@ -35,16 +35,8 @@ targets = [
db-path = "~/.cargo/advisory-db"
# The url(s) of the advisory databases to use
db-urls = ["https://github.com/rustsec/advisory-db"]
# The lint level for security vulnerabilities
vulnerability = "deny"
# The lint level for unmaintained crates
unmaintained = "warn"
# The lint level for crates that have been yanked from their source registry
yanked = "warn"
# The lint level for crates with security notices. Note that as of
# 2019-12-17 there are no security notice advisories in
# https://github.com/rustsec/advisory-db
notice = "warn"
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
Expand All @@ -70,36 +62,15 @@ ignore = [
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "deny"
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"MIT",
"Apache-2.0",
"BSD-3-Clause",
"Unicode-3.0",
]
# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
deny = [
#"Nokia",
]
# Lint level for licenses considered copyleft
copyleft = "warn"
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
# * both - The license will be approved if it is both OSI-approved *AND* FSF
# * either - The license will be approved if it is either OSI-approved *OR* FSF
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
# * neither - This predicate is ignored and the default lint level is used
allow-osi-fsf-free = "neither"
# Lint level used when no other predicates are matched
# 1. License isn't in the allow or deny lists
# 2. License isn't copyleft
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
default = "deny"
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
# canonical license text of a valid SPDX license file.
Expand Down
4 changes: 2 additions & 2 deletions src/builtins/filters/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use lazy_static::lazy_static;
use regex::{Captures, Regex};
use serde_json::value::{to_value, Value};
use unic_segment::GraphemeIndices;
use unicode_segmentation::UnicodeSegmentation;

#[cfg(feature = "urlencode")]
use percent_encoding::{percent_encode, AsciiSet, NON_ALPHANUMERIC};
Expand Down Expand Up @@ -165,7 +165,7 @@ pub fn truncate(value: &Value, args: &HashMap<String, Value>) -> Result<Value> {
None => "…".to_string(),
};

let graphemes = GraphemeIndices::new(&s).collect::<Vec<(usize, &str)>>();
let graphemes = s.grapheme_indices(true).collect::<Vec<(usize, &str)>>();

// Nothing to truncate?
if length >= graphemes.len() {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/for_loop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::borrow::Cow;

use serde_json::Value;
use unic_segment::Graphemes;
use unicode_segmentation::UnicodeSegmentation;

use crate::renderer::stack_frame::Val;

Expand Down Expand Up @@ -58,7 +58,7 @@ impl<'a> ForLoopValues<'a> {
}
},
ForLoopValues::String(ref values) => {
let mut graphemes = Graphemes::new(values.as_str().expect("Is string"));
let mut graphemes = values.as_str().expect("Is string").graphemes(true);
Cow::Owned(Value::String(graphemes.nth(i).expect("Value").to_string()))
}
ForLoopValues::Object(ref values) => values.get(i).expect("Value").1.clone(),
Expand Down