Skip to content

Commit 50ce37a

Browse files
committed
fix: typos
1 parent 24891e1 commit 50ce37a

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

minijinja/src/environment.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ fn default_formatter() -> Arc<FormatterFunc> {
4646
}
4747

4848
/// The maximum recursion in the VM. Normally each stack frame
49-
/// adds one to this counter (eg: every time a frame is added).
49+
/// adds one to this counter (e.g., every time a frame is added).
5050
/// However in some situations more depth is pushed if the cost
51-
/// of the stack frame is higher. Raising this above this limit
51+
/// of the stack frame is higher. Raising this limit
5252
/// requires enabling the `stacker` feature.
5353
const MAX_RECURSION: usize = 500;
5454

@@ -192,8 +192,9 @@ impl<'source> Environment<'source> {
192192
/// env.add_template_owned("index.html".to_string(), "Hello {{ name }}!".to_string()).unwrap();
193193
/// ```
194194
///
195-
/// **Note**: the name is a bit of a misnomer as this API also allows to borrow too as
196-
/// the parameters are actually [`Cow`]. This method fails if the template has a syntax error.
195+
/// **Note**: the name is a bit of a misnomer as this API also allows borrowing,
196+
/// as the parameters are actually [`Cow`]. This method fails if the template
197+
/// has a syntax error.
197198
pub fn add_template_owned<N, S>(&mut self, name: N, source: S) -> Result<(), Error>
198199
where
199200
N: Into<Cow<'source, str>>,
@@ -407,8 +408,7 @@ impl<'source> Environment<'source> {
407408

408409
/// Loads a template from a string.
409410
///
410-
/// In some cases you really only need to work with (eg: render) a template to be
411-
/// rendered once only.
411+
/// In some cases you only need to work with (e.g., render) a template once.
412412
///
413413
/// ```
414414
/// # use minijinja::{Environment, context};
@@ -492,7 +492,7 @@ impl<'source> Environment<'source> {
492492
/// invoked with the name of the template and can make an initial auto
493493
/// escaping decision based on that. The default implementation
494494
/// ([`default_auto_escape_callback`](defaults::default_auto_escape_callback))
495-
/// turn on escaping depending on the file extension.
495+
/// turns on escaping depending on the file extension.
496496
///
497497
/// ```
498498
/// # use minijinja::{Environment, AutoEscape};
@@ -675,9 +675,9 @@ impl<'source> Environment<'source> {
675675

676676
/// Compiles an expression.
677677
///
678-
/// This lets one compile an expression in the template language and
679-
/// receive the output. This lets one use the expressions of the language
680-
/// be used as a minimal scripting language. For more information and an
678+
/// This lets you compile an expression in the template language and evaluate it.
679+
/// This makes it possible to use the language's expressions as a minimal
680+
/// scripting language. For more information and an
681681
/// example see [`Expression`].
682682
pub fn compile_expression(&self, expr: &'source str) -> Result<Expression<'_, 'source>, Error> {
683683
self._compile_expression(expr)

minijinja/src/filters.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ mod builtins {
10021002
/// This filter is only available if the `json` feature is enabled. The resulting
10031003
/// value is safe to use in HTML as well as it will not contain any special HTML
10041004
/// characters. The optional parameter to the filter can be set to `true` to enable
1005-
/// pretty printing. Not that the `"` character is left unchanged as it's the
1005+
/// pretty printing. Note that the `"` character is left unchanged as it's the
10061006
/// JSON string delimiter. If you want to pass JSON serialized this way into an
10071007
/// HTTP attribute use single quoted HTML attributes:
10081008
///
@@ -1068,13 +1068,13 @@ mod builtins {
10681068
})
10691069
}
10701070

1071-
/// Indents Value with spaces
1071+
/// Indents a value with spaces.
10721072
///
10731073
/// The first optional parameter to the filter can be set to `true` to
10741074
/// indent the first line. The parameter defaults to false.
1075-
/// the second optional parameter to the filter can be set to `true`
1075+
/// The second optional parameter to the filter can be set to `true`
10761076
/// to indent blank lines. The parameter defaults to false.
1077-
/// This filter is useful, if you want to template yaml-files
1077+
/// This filter is useful if you want to template YAML files.
10781078
///
10791079
/// ```jinja
10801080
/// example:

minijinja/src/template.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ impl<'env, 'source> Template<'env, 'source> {
321321

322322
/// Renders the template into an [`io::Write`].
323323
///
324-
/// This works exactly like [`render`](Self::render) but instead writes the template
325-
/// as it's evaluating into an [`io::Write`].
324+
/// This works exactly like [`render`](Self::render), but writes the template
325+
/// into an [`io::Write`] as it is evaluated.
326326
///
327327
/// ```
328328
/// # use minijinja::{Environment, context};
@@ -402,7 +402,7 @@ impl<'env, 'source> Template<'env, 'source> {
402402
/// Returns a set of all undeclared variables in the template.
403403
///
404404
/// This returns a set of all variables that might be looked up
405-
/// at runtime by the template. Since this is runs a static
405+
/// at runtime by the template. Since this runs a static
406406
/// analysis, the actual control flow is not considered. This
407407
/// also cannot take into account what happens due to includes,
408408
/// imports or extending. If `nested` is set to `true`, then also

minijinja/src/vm/state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl<'template, 'env> State<'template, 'env> {
332332
/// Temps are similar to context values but the engine never looks them up
333333
/// on their own and they are not scoped. The lifetime of temps is limited
334334
/// to the rendering process of a template. Temps are useful so that
335-
/// filters and other things can temporary stash away state without having
335+
/// filters and other things can temporarily stash away state without having
336336
/// to resort to thread locals which are hard to manage. Unlike context
337337
/// variables, temps can also be modified during evaluation by filters and
338338
/// functions.
@@ -370,7 +370,7 @@ impl<'template, 'env> State<'template, 'env> {
370370

371371
/// Shortcut for registering an object as a temp.
372372
///
373-
/// If the value is already there, it's returned as object, if it's
373+
/// If the value is already there, it's returned as an object. If it's
374374
/// not there yet, the function is invoked to create it.
375375
///
376376
/// # Example
@@ -394,7 +394,7 @@ impl<'template, 'env> State<'template, 'env> {
394394
///
395395
/// # Panics
396396
///
397-
/// This will panick if the value registered under that name is not
397+
/// This will panic if the value registered under that name is not
398398
/// the object expected.
399399
pub fn get_or_set_temp_object<O, F>(&self, name: &str, f: F) -> Arc<O>
400400
where
@@ -449,7 +449,7 @@ impl<'a> ArgType<'a> for &State<'_, '_> {
449449
}
450450
}
451451

452-
/// Tracks a block and it's parents for super.
452+
/// Tracks a block and its parents for super.
453453
#[derive(Default)]
454454
pub(crate) struct BlockStack<'template, 'env> {
455455
instructions: Vec<&'template Instructions<'env>>,

0 commit comments

Comments
 (0)