Update Rust crate minijinja to v1 by renovate[bot] · Pull Request #223 · zdz/ServerStatus-Rust
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| minijinja | dependencies | major | 0.33 -> 1.0 |
Release Notes
mitsuhiko/minijinja (minijinja)
v1.0.10
- Added
intandfloatfilters. #372 - Added
integerandfloattests. #373 - Fixed an issue that caused the CLI not to run when the
replfeature
was disabled. #374 - Added
-n/--no-newlineoption to CLI. #375
v1.0.9
- Fixed a memory leak involving macros. Previously using macros was
leaking memory due to an undetected cycle. #359 - The
debugfunction in templates can now also be used to print out
the debug output of a variable. #356 - Added a new
stackerfeature which allows raising of the recursion
limits. It enables monitoring of the call stack via stacker
and automatically acquires additional memory when the call stack
runs out of space. #354
v1.0.8
- Large integer literals in templates are now correctly handled. #353
- Relax the trait bounds of
Value::downcast_object_ref/
Object::downcast_ref/Object::isand added support for downcasting
of types that were directly created withValue::from_seq_object
andValue::from_struct_object. #349 - Overflowing additions on very large integers now fails rather than
silently wrapping around. #350 - Fixed a few overflow panics: dividing integers with an overflow and
- Exposed missing new functionality for the Python binding. #339
v1.0.7
- Added support for
keep_trailing_newlineswhich allows you to disable
the automatic trimming of trailing newlines. #334 - Added
minijinja-cliwhich lets you render and debug templates from
the command line. #331 - Macros called with the wrong state will no longer panic. #330
- Debug output of
Value::UNDEFINEDandValue::from(())is now
undefinedandnonerather thanUndefinedandNone. This was
an accidental inconsistency. - Fixed a potential panic in debug error printing.
- Added
Environment::set_path_join_callbackandState::get_template
to support path joining. This is for greater compatibility with Jinja2
where path joining was overridable. With this you can configure the
engine so that paths used byincludeorextendscan be relative to
the current template. #328 - The default auto-escape detection now accepts
.html.j2as alias for
.htmlas well as for all other choices. In general.j2as an extension
is now generally supported.
v1.0.6
- Fixed iso datetime formatting not handling negative offsets correctly. #327
- Re-report
Valuedirectly from the crate root for convenience. - It's now possible to
deserializefrom aValue. Additionally the
ViaDeserialize<T>argument type was added to support value conversions
via serde as argument type. #325
v1.0.5
- Added the ability to merge multiple values with the
context!
macro. (#317) Option<T>now acceptsnonein filters. Previously only
undefined values were accepted. This bugfix might have a minor impact
on code that relied in this behavior. (#320)- Fix a compilation error for
minijinja-contribif thetimezone
feature is not enabled.
v1.0.4
- Added the
args!macro which can be used to create an argument
slice on the stack. (#311) - Improved error reporting for missing keyword arguments.
- Added
chronosupport to the time filters in theminijinja-contribcrate.
v1.0.3
- Republished
1.0.2with fixed docs.
v1.0.2
- Added
TryFromandArgTypeforArc<str>. - Added
datetimeformat,dateformat,timeformatandnow()to the
contrib crate. (#309)
v1.0.1
- Added
Environment::compile_expression_ownedto allow compiled expressions
to be held without requiring a reference. #383
v1.0.0
-
Support unicode sorting for filters when the
unicodefeature is enabled.
This also fixes confusing behavior when mixed types were sorted. (#299) -
Added
json5as file extension for JSON formatter. -
The autoreload crate now supports fast reloading by just clearning the
already templates. This is enabled viaset_fast_reloadon the
Notifier.
Note: This also includes all the changes in the different 1.0.0 alphas.
Breaking Changes
1.0 includes a lot of changes that are breaking. However they should with
some minor exceptions be rather trivial changes.
-
Environment::source,Environment::set_sourceand theSourcetype
together with thesourcefeature were removed. The replacement is the
newloaderfeature which adds theadd_template_ownedandset_loader
APIs. The functionality previously provided bySource::from_pathis
now available viapath_loader.Old:
let mut source = Source::with_loader(|name| ...); source.add_template("foo", "...").unwrap(); let mut env = Environment::new(); env.set_source(source);
New:
let mut env = Environment::new(); env.set_loader(|name| ...); env.add_template_owned("foo", "...").unwrap();
Old:
let mut env = Environment::new(); env.set_source(Source::from_path("templates"));
New:
let mut env = Environment::new(); env.set_loader(path_loader("templates"));
-
Template::render_blockandTemplate::render_block_to_writewere
replaced with APIs of the same name on theStatereturned by
Template::eval_to_stateorTemplate::render_and_return_state:Old:
let rv = tmpl.render_block("name", ctx)?;
New:
let rv = tmpl.eval_to_state(ctx)?.render_block("name")?;
-
Kwargs::from_argswas removed as API as it's no longer necessary since
thefrom_argsfunction now provides the same functionality:Before:
// just split let (args, kwargs) = Kwargs::from_args(values); // split and parse let (args, kwargs) = Kwargs::from_args(values); let (a, b): (i32, i32) = from_args(args)?;
After:
// just split let (args, kwargs): (&[Value], Kwargs) = from_args(values)?; // split and parse let (a, b, kwargs): (i32, i32, Kwargs) = from_args(values)?;
-
The
testutilsfeature andtestutilsmodule were removed. Instead you
can now directly create an emptyStateand use the methods provided
to invoke filters.Before:
let env = Environment::new(); let rv = apply_filter(&env, "upper", &["hello world".into()]).unwrap();
After:
let env = Environment::new(); let rv = env.empty_state().apply_filter("upper", &["hello world".into()]).unwrap();
Before:
let env = Environment::new(); let rv = perform_test(&env, "even", &[42.into()]).unwrap();
After:
let env = Environment::new(); let rv = env.empty_state().perform_test("even", &[42.into()]).unwrap();
Before:
let env = Environment::new(); let rv = format(&env, 42.into()).unwrap();
After:
let env = Environment::new(); let rv = env.empty_state().format(42.into()).unwrap();
-
internand some APIs that useArc<String>now useArc<str>. This
means that for instanceStructObject::fieldsreturnsArc<str>instead
ofArc<String>. All the type conversions that previously accepted
Arc<String>now only supportArc<str>. -
State::current_callwas removed without replacement. This information
was unreliably maintained in the engine and caused issues with recursive
calls. If you have a need for this API please reach out on the issue
tracker. -
Output::is_discardingwas removed without replacement. This is
an implementation detail and was unintentionally exposed. You should not
write code that depends on the internal state of theOutput.
v0.34.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.