Skip to content

Commit

Permalink
fixed typos (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad authored Nov 10, 2024
1 parent 90a5a2e commit a10bb32
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions UPDATING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Updating to MiniJinja 2

MiniJinja 2.0 is a major update to MiniJinja that changes a lot of core
internals and cleans up some APIs. In particular it resolves somes limitations
internals and cleans up some APIs. In particular it resolves some limitations
in the engine in relation to working with dynamic objects, unlocks potentials
for future performance improvements and enhancements. This document helps with
upgrading to that version.
Expand Down Expand Up @@ -93,12 +93,12 @@ In a nutshell:

When working with objects of an unknown type, you can use the new `DynObject`
struct which is a type erased box over `Arc<Object>`. `Value::as_object` now
returns an `Option<&DynObject>` compared to previosly an `Option<&dyn Object>`
returns an `Option<&DynObject>` compared to previously an `Option<&dyn Object>`
as an example. The `DynObject` can be cheaply cloned which bumps the reference
count.

On the value type, the object related APIs were changed a bit to better
accomodate for the new trait:
accommodate for the new trait:

* `Value::as_struct` was removed, use `Value::as_object` instead.
* `Value::as_seq` was removed, use `Value::as_object` instead.
Expand Down Expand Up @@ -313,7 +313,7 @@ impl Object for Markdown {

## Stack Ref

The old `minijinja-stack-ref` module was removed as it can no longer accomodate the
The old `minijinja-stack-ref` module was removed as it can no longer accommodate the
new object model. However that module largely is no longer useful as the new object
system is powerful enough to support it _for the most part_. While it's not possible
any more to return references to objects on the stack, you can now trivially work with
Expand Down
2 changes: 1 addition & 1 deletion minijinja-cabi/include/minijinja.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ MINIJINJA_API struct mj_value mj_value_get_by_index(struct mj_value value, uint6
MINIJINJA_API struct mj_value mj_value_get_by_str(struct mj_value value, const char *key);

/*
Looks up an element by a vaue
Looks up an element by a value
*/
MINIJINJA_API struct mj_value mj_value_get_by_value(struct mj_value value, struct mj_value key);

Expand Down
4 changes: 2 additions & 2 deletions minijinja-cabi/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
#[repr(C)]
pub struct mj_value {
// Motivation on the size here: The size of `Value` is really not
// known and since cbindgen has no way to guarnatee us a matching
// known and since cbindgen has no way to guarantee us a matching
// size we have to be creative. The dominating type size wise is
// most likely going to be SmallStr which is a u8+[u8; 22] plus the
// enum discriminant (u8).
Expand Down Expand Up @@ -335,7 +335,7 @@ ffi_fn! {
}

ffi_fn! {
/// Looks up an element by a vaue
/// Looks up an element by a value
unsafe fn mj_value_get_by_value(_scope, value: mj_value, key: mj_value) -> mj_value {
value.get_item(&key as &Value).unwrap_or_default().into()
}
Expand Down
2 changes: 1 addition & 1 deletion minijinja-cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pub(super) fn make_command() -> Command {
.long_help("\
Dump internals of a template to stdout.\n\n\
\
This feature is primarily useful to debug what is going on in a MiniJinja tempalte. \
This feature is primarily useful to debug what is going on in a MiniJinja template. \
'instructions' will dump out the bytecode that the engine generated, 'ast' dumps out \
the AST in a text only format and 'tokens' will print a line per token of the template \
after lexing.")
Expand Down
4 changes: 2 additions & 2 deletions minijinja-cli/src/long_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Most of the functionality is handled via options, but there are two positional a

Various file formats are supported for the template context, the exact formats depend on the features enabled at compilation time.

Configuration is loaded from $HOME/minijinja.toml and environment variables, before being overridden by command line options. The environment variables are documented with the options that they correspond to. Note that flags (boolen values) are reconfigured with true/false or 1/0 respectively. For instance --no-include corresponds to MINIJINJA_INCLUDE=false. Not all options can be configured from environment variables or config options.
Configuration is loaded from $HOME/minijinja.toml and environment variables, before being overridden by command line options. The environment variables are documented with the options that they correspond to. Note that flags (boolean values) are reconfigured with true/false or 1/0 respectively. For instance --no-include corresponds to MINIJINJA_INCLUDE=false. Not all options can be configured from environment variables or config options.

Examples:

Expand All @@ -14,4 +14,4 @@ Examples:

minijinja-cli --template="Hello {{ name }}!" -Dname=World

minijinja-cli --expr "1 + 1"
minijinja-cli --expr "1 + 1"
4 changes: 2 additions & 2 deletions minijinja-cli/tests/snapshots/test_basic__long_help.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ features enabled at compilation time.

Configuration is loaded from $HOME/minijinja.toml and environment variables, before being overridden
by command line options. The environment variables are documented with the options that they
correspond to. Note that flags (boolen values) are reconfigured with true/false or 1/0
correspond to. Note that flags (boolean values) are reconfigured with true/false or 1/0
respectively. For instance --no-include corresponds to MINIJINJA_INCLUDE=false. Not all options
can be configured from environment variables or config options.

Expand Down Expand Up @@ -293,7 +293,7 @@ Advanced:
--dump <KIND>
Dump internals of a template to stdout.

This feature is primarily useful to debug what is going on in a MiniJinja tempalte.
This feature is primarily useful to debug what is going on in a MiniJinja template.
'instructions' will dump out the bytecode that the engine generated, 'ast' dumps out the
AST in a text only format and 'tokens' will print a line per token of the template after
lexing.
Expand Down
4 changes: 2 additions & 2 deletions minijinja-embed/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ use std::path::Path;
/// # }
/// ```
///
/// To embed diffent folders, alternative bundle names can be provided.
/// Also tempaltes can be filtered down by extension to avoid accidentally
/// To embed different folders, alternative bundle names can be provided.
/// Also templates can be filtered down by extension to avoid accidentally
/// including unexpected templates.
///
/// ```rust
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/compiler/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ impl<'source> CodeGenerator<'source> {

// filter expressions work like a nested for loop without
// the special loop variable. in one loop, the condition is checked and
// passing items accumlated into a list. in the second, that list is
// passing items accumulated into a list. in the second, that list is
// iterated over normally
if let Some(ref filter_expr) = for_loop.filter_expr {
self.add(Instruction::LoadConst(Value::from(0usize)));
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ mod builtins {
/// The attribute can use dot notation for nested access, like `"address.city"``.
/// The values are sorted first so only one group is returned for each unique value.
/// The attribute can be passed as first argument or as keyword argument named
/// `atttribute`.
/// `attribute`.
///
/// For example, a list of User objects with a city attribute can be
/// rendered in groups. In this example, grouper refers to the city value of
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub use self::value::Value;
pub use self::macros::__context;
pub use self::vm::State;

// fowards compatibility
// forwards compatibility
#[cfg(not(feature = "serde"))]
const _: () = {
#[deprecated(
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ impl Value {
/// * undefined or none: value returned unchanged.
/// * string and bytes: returns a reversed version of that value
/// * iterables: returns a reversed version of the iterable. If the iterable is not
/// reversable itself, it consumes it and then reverses it.
/// reversible itself, it consumes it and then reverses it.
pub fn reverse(&self) -> Result<Value, Error> {
match self.0 {
ValueRepr::Undefined | ValueRepr::None => Some(self.clone()),
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/value/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub trait Object: fmt::Debug + Send + Sync {
///
/// By default the length is taken by calling [`enumerate`](Self::enumerate) and
/// inspecting the [`Enumerator`]. This means that in order to determine
/// the length, an iteration is started. If you this is a problem for your
/// the length, an iteration is started. If you think this is a problem for your
/// uses, you can manually implement this. This might for instance be
/// needed if your type can only be iterated over once.
fn enumerator_len(self: &Arc<Self>) -> Option<usize> {
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/value/type_erase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ macro_rules! type_erase {
}
)*

/// Returns the type name of the conrete underlying type.
/// Returns the type name of the concrete underlying type.
$v fn type_name(&self) -> &'static str {
(vt(self).__type_name)()
}
Expand Down

0 comments on commit a10bb32

Please sign in to comment.