Minor clean-ups

* add missing softlinks
* sorted `Cargo.toml`s in root and testing
* suppress warnings in expanded code
This commit is contained in:
René Kijewski 2025-01-29 12:30:52 +01:00
parent e81ca4263e
commit a101903871
12 changed files with 41 additions and 20 deletions

View File

@ -113,6 +113,7 @@ jobs:
with:
tool: cargo-sort
- run: |
cargo sort --check --check-format --grouped
set -eu
for PKG in \
examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/salvo-app examples/warp-app fuzzing \

View File

@ -1,3 +1,10 @@
[workspace]
members = ["rinja", "rinja_derive", "rinja_parser", "testing", "testing-alloc", "testing-no-std"]
members = [
"rinja",
"rinja_derive",
"rinja_parser",
"testing",
"testing-alloc",
"testing-no-std"
]
resolver = "2"

View File

@ -26,11 +26,14 @@ harness = false
[dependencies]
rinja_derive = { version = "=0.3.5", path = "../rinja_derive" }
percent-encoding = { version = "2.1.0", optional = true, default-features = false }
itoa = "1.0.11"
# needed by feature "serde_json"
serde = { version = "1.0", optional = true, default-features = false }
serde_json = { version = "1.0", optional = true, default-features = false, features = [] }
itoa = "1.0.11"
# needed by feature "urlencode"
percent-encoding = { version = "2.1.0", optional = true, default-features = false }
[dev-dependencies]
assert_matches = "1.5.0"

View File

@ -136,9 +136,11 @@ impl<'a, 'h> Generator<'a, 'h> {
where \
RinjaW: rinja::helpers::core::fmt::Write + ?rinja::helpers::core::marker::Sized\
{\
use rinja::filters::{AutoEscape as _, WriteWritable as _};\
use rinja::helpers::ResultConverter as _;\
use rinja::helpers::core::fmt::Write as _;",
#[allow(unused_imports)]\
use rinja::{\
filters::{AutoEscape as _, WriteWritable as _},\
helpers::{ResultConverter as _, core::fmt::Write as _},\
};",
);
// Make sure the compiler understands that the generated code depends on the template files.

View File

@ -35,9 +35,11 @@ fn compare(jinja: &str, expected: &str, fields: &[(&str, &str)], size_hint: usiz
where
RinjaW: rinja::helpers::core::fmt::Write + ?rinja::helpers::core::marker::Sized,
{
use rinja::filters::{AutoEscape as _, WriteWritable as _};
use rinja::helpers::ResultConverter as _;
use rinja::helpers::core::fmt::Write as _;
#[allow(unused_imports)]
use rinja::{
filters::{AutoEscape as _, WriteWritable as _},
helpers::{ResultConverter as _, core::fmt::Write as _},
};
#expected
rinja::Result::Ok(())
}

1
testing/.rustfmt.toml Symbolic link
View File

@ -0,0 +1 @@
../.rustfmt.toml

View File

@ -6,10 +6,13 @@ edition = "2021"
rust-version = "1.81"
publish = false
[features]
default = ["code-in-doc", "serde_json"]
code-in-doc = ["rinja/code-in-doc"]
serde_json = ["dep:serde_json", "rinja/serde_json"]
[[bench]]
name = "all"
harness = false
[[bench]]
name = "normalize_identifier"
harness = false
[dependencies]
rinja = { path = "../rinja", version = "0.3.5" }
@ -27,13 +30,10 @@ criterion = "0.5"
phf = { version = "0.11", features = ["macros" ] }
trybuild = "1.0.100"
[[bench]]
name = "all"
harness = false
[[bench]]
name = "normalize_identifier"
harness = false
[features]
default = ["code-in-doc", "serde_json"]
code-in-doc = ["rinja/code-in-doc"]
serde_json = ["dep:serde_json", "rinja/serde_json"]
[lints.rust]
# Set in `build.rs` if we are compiling in stable rust, used by `ui.rs`

1
testing/LICENSE-APACHE Symbolic link
View File

@ -0,0 +1 @@
../LICENSE-APACHE

1
testing/LICENSE-MIT Symbolic link
View File

@ -0,0 +1 @@
../LICENSE-MIT

1
testing/_typos.toml Symbolic link
View File

@ -0,0 +1 @@
../_typos.toml

1
testing/deny.toml Symbolic link
View File

@ -0,0 +1 @@
../deny.toml

1
testing/tomlfmt.toml Symbolic link
View File

@ -0,0 +1 @@
../tomlfmt.toml