From a10bb321fa675477268f8766162a63ba0b2d1f22 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 10 Nov 2024 08:43:15 -0500 Subject: [PATCH] fixed typos (#639) --- UPDATING.md | 8 ++++---- minijinja-cabi/include/minijinja.h | 2 +- minijinja-cabi/src/value.rs | 4 ++-- minijinja-cli/src/command.rs | 2 +- minijinja-cli/src/long_help.txt | 4 ++-- minijinja-cli/tests/snapshots/test_basic__long_help.snap | 4 ++-- minijinja-embed/src/lib.rs | 4 ++-- minijinja/src/compiler/codegen.rs | 2 +- minijinja/src/filters.rs | 2 +- minijinja/src/lib.rs | 2 +- minijinja/src/value/mod.rs | 2 +- minijinja/src/value/object.rs | 2 +- minijinja/src/value/type_erase.rs | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/UPDATING.md b/UPDATING.md index 80059de0..5011247d 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -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. @@ -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`. `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. @@ -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 diff --git a/minijinja-cabi/include/minijinja.h b/minijinja-cabi/include/minijinja.h index f7f381aa..b312912a 100644 --- a/minijinja-cabi/include/minijinja.h +++ b/minijinja-cabi/include/minijinja.h @@ -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); diff --git a/minijinja-cabi/src/value.rs b/minijinja-cabi/src/value.rs index 3738e931..03d2a73d 100644 --- a/minijinja-cabi/src/value.rs +++ b/minijinja-cabi/src/value.rs @@ -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). @@ -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() } diff --git a/minijinja-cli/src/command.rs b/minijinja-cli/src/command.rs index bee8e329..7432230d 100644 --- a/minijinja-cli/src/command.rs +++ b/minijinja-cli/src/command.rs @@ -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.") diff --git a/minijinja-cli/src/long_help.txt b/minijinja-cli/src/long_help.txt index 33d3b214..f221b8a6 100644 --- a/minijinja-cli/src/long_help.txt +++ b/minijinja-cli/src/long_help.txt @@ -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: @@ -14,4 +14,4 @@ Examples: minijinja-cli --template="Hello {{ name }}!" -Dname=World - minijinja-cli --expr "1 + 1" \ No newline at end of file + minijinja-cli --expr "1 + 1" diff --git a/minijinja-cli/tests/snapshots/test_basic__long_help.snap b/minijinja-cli/tests/snapshots/test_basic__long_help.snap index 4f6bbcac..2c885edc 100644 --- a/minijinja-cli/tests/snapshots/test_basic__long_help.snap +++ b/minijinja-cli/tests/snapshots/test_basic__long_help.snap @@ -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. @@ -293,7 +293,7 @@ Advanced: --dump 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. diff --git a/minijinja-embed/src/lib.rs b/minijinja-embed/src/lib.rs index 319edebb..aa719fa7 100644 --- a/minijinja-embed/src/lib.rs +++ b/minijinja-embed/src/lib.rs @@ -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 diff --git a/minijinja/src/compiler/codegen.rs b/minijinja/src/compiler/codegen.rs index f5550d97..007b8e41 100644 --- a/minijinja/src/compiler/codegen.rs +++ b/minijinja/src/compiler/codegen.rs @@ -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))); diff --git a/minijinja/src/filters.rs b/minijinja/src/filters.rs index d324c938..535c0f42 100644 --- a/minijinja/src/filters.rs +++ b/minijinja/src/filters.rs @@ -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 diff --git a/minijinja/src/lib.rs b/minijinja/src/lib.rs index 0557aef9..775ae397 100644 --- a/minijinja/src/lib.rs +++ b/minijinja/src/lib.rs @@ -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( diff --git a/minijinja/src/value/mod.rs b/minijinja/src/value/mod.rs index 1fec1316..95e577cc 100644 --- a/minijinja/src/value/mod.rs +++ b/minijinja/src/value/mod.rs @@ -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 { match self.0 { ValueRepr::Undefined | ValueRepr::None => Some(self.clone()), diff --git a/minijinja/src/value/object.rs b/minijinja/src/value/object.rs index b2fe3b97..a77aa491 100644 --- a/minijinja/src/value/object.rs +++ b/minijinja/src/value/object.rs @@ -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) -> Option { diff --git a/minijinja/src/value/type_erase.rs b/minijinja/src/value/type_erase.rs index b966d29d..6850f700 100644 --- a/minijinja/src/value/type_erase.rs +++ b/minijinja/src/value/type_erase.rs @@ -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)() }