aboutsummaryrefslogtreecommitdiff
path: root/mingling_core
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_core')
-rw-r--r--mingling_core/src/any.rs7
-rw-r--r--mingling_core/src/asset/global_resource.rs9
-rw-r--r--mingling_core/src/renderer.rs2
-rw-r--r--mingling_core/src/renderer/structural.rs21
-rw-r--r--mingling_core/tests/test-all/Cargo.lock10
-rw-r--r--mingling_core/tests/test-basic/Cargo.lock10
-rw-r--r--mingling_core/tests/test-comp/Cargo.lock10
-rw-r--r--mingling_core/tests/test-dispatch-tree/Cargo.lock10
-rw-r--r--mingling_core/tests/test-repl/Cargo.lock10
-rw-r--r--mingling_core/tests/test-structural-renderer/Cargo.lock10
10 files changed, 38 insertions, 61 deletions
diff --git a/mingling_core/src/any.rs b/mingling_core/src/any.rs
index b586f09..2680f43 100644
--- a/mingling_core/src/any.rs
+++ b/mingling_core/src/any.rs
@@ -1,5 +1,5 @@
-use crate::{Groupped, ProgramCollect};
use crate::error::ChainProcessError;
+use crate::{Groupped, ProgramCollect};
#[doc(hidden)]
pub mod group;
@@ -136,7 +136,10 @@ impl<G> From<AnyOutput<G>> for ChainProcess<G> {
}
}
-impl<G> From<()> for ChainProcess<G> where G: ProgramCollect<Enum = G> {
+impl<G> From<()> for ChainProcess<G>
+where
+ G: ProgramCollect<Enum = G>,
+{
fn from(_v: ()) -> Self {
G::build_empty_result().route_chain()
}
diff --git a/mingling_core/src/asset/global_resource.rs b/mingling_core/src/asset/global_resource.rs
index 651655a..3d0af7b 100644
--- a/mingling_core/src/asset/global_resource.rs
+++ b/mingling_core/src/asset/global_resource.rs
@@ -80,9 +80,7 @@ where
/// owned value. The caller must call [`__store_res`] to write back modifications.
#[doc(hidden)]
#[must_use]
- pub fn __extract_res_mut<Res: 'static + Default + ResourceMarker + Send + Sync>(
- &self,
- ) -> Res {
+ pub fn __extract_res_mut<Res: 'static + Default + ResourceMarker + Send + Sync>(&self) -> Res {
let Ok(mut guard) = self.resources.lock() else {
return Res::res_default();
};
@@ -103,10 +101,7 @@ where
///
/// Stores a modified resource value back into the global store.
#[doc(hidden)]
- pub fn __store_res<Res: 'static + Send + Sync + ResourceMarker>(
- &self,
- val: Res,
- ) {
+ pub fn __store_res<Res: 'static + Send + Sync + ResourceMarker>(&self, val: Res) {
if let Ok(mut guard) = self.resources.lock() {
guard.insert(TypeId::of::<Res>(), Box::new(Arc::new(val)));
}
diff --git a/mingling_core/src/renderer.rs b/mingling_core/src/renderer.rs
index 435518d..6e67431 100644
--- a/mingling_core/src/renderer.rs
+++ b/mingling_core/src/renderer.rs
@@ -1,3 +1,3 @@
+pub mod render_result;
#[cfg(feature = "structural_renderer")]
pub mod structural;
-pub mod render_result;
diff --git a/mingling_core/src/renderer/structural.rs b/mingling_core/src/renderer/structural.rs
index 16ce471..30255aa 100644
--- a/mingling_core/src/renderer/structural.rs
+++ b/mingling_core/src/renderer/structural.rs
@@ -1,5 +1,6 @@
use crate::{
- StructuralRendererSetting, RenderResult, renderer::structural::error::StructuralRendererSerializeError,
+ RenderResult, StructuralRendererSetting,
+ renderer::structural::error::StructuralRendererSerializeError,
};
use serde::Serialize;
@@ -103,9 +104,7 @@ impl StructuralRenderer {
data: &T,
r: &mut RenderResult,
) -> Result<(), StructuralRendererSerializeError> {
- let pretty_config = ron::ser::PrettyConfig::new()
- .new_line("\n")
- .indentor(" ");
+ let pretty_config = ron::ser::PrettyConfig::new().new_line("\n").indentor(" ");
let ron_string = ron::ser::to_string_pretty(data, pretty_config)
.map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
@@ -123,8 +122,8 @@ impl StructuralRenderer {
data: &T,
r: &mut RenderResult,
) -> Result<(), StructuralRendererSerializeError> {
- let toml_string =
- toml::to_string(data).map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
+ let toml_string = toml::to_string(data)
+ .map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
r.print(&toml_string);
Ok(())
}
@@ -196,8 +195,11 @@ mod tests {
#[test]
fn test_render_to_json_pretty() {
let mut r = RenderResult::default();
- let result =
- StructuralRenderer::render(&test_data(), &StructuralRendererSetting::JsonPretty, &mut r);
+ let result = StructuralRenderer::render(
+ &test_data(),
+ &StructuralRendererSetting::JsonPretty,
+ &mut r,
+ );
assert!(result.is_ok());
let output: String = r.into();
// Pretty JSON has newlines
@@ -261,7 +263,8 @@ mod tests {
#[test]
fn test_render_dispatches_json() {
let mut r = RenderResult::default();
- let result = StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Json, &mut r);
+ let result =
+ StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Json, &mut r);
assert!(result.is_ok());
assert!(!r.is_empty());
}
diff --git a/mingling_core/tests/test-all/Cargo.lock b/mingling_core/tests/test-all/Cargo.lock
index be11bf7..d947c0b 100644
--- a/mingling_core/tests/test-all/Cargo.lock
+++ b/mingling_core/tests/test-all/Cargo.lock
@@ -111,7 +111,7 @@ checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -121,9 +121,7 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
"just_template",
@@ -136,9 +134,7 @@ dependencies = [
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",
diff --git a/mingling_core/tests/test-basic/Cargo.lock b/mingling_core/tests/test-basic/Cargo.lock
index 618d261..8aecb31 100644
--- a/mingling_core/tests/test-basic/Cargo.lock
+++ b/mingling_core/tests/test-basic/Cargo.lock
@@ -10,7 +10,7 @@ checksum = "5454cda0d57db59778608d7a47bff5b16c6705598265869fb052b657f66cf05e"
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -18,18 +18,14 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
]
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",
diff --git a/mingling_core/tests/test-comp/Cargo.lock b/mingling_core/tests/test-comp/Cargo.lock
index 244f259..b6e36ed 100644
--- a/mingling_core/tests/test-comp/Cargo.lock
+++ b/mingling_core/tests/test-comp/Cargo.lock
@@ -31,7 +31,7 @@ dependencies = [
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -39,9 +39,7 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
"just_template",
@@ -49,9 +47,7 @@ dependencies = [
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",
diff --git a/mingling_core/tests/test-dispatch-tree/Cargo.lock b/mingling_core/tests/test-dispatch-tree/Cargo.lock
index 1a1a5d4..93ea87c 100644
--- a/mingling_core/tests/test-dispatch-tree/Cargo.lock
+++ b/mingling_core/tests/test-dispatch-tree/Cargo.lock
@@ -10,7 +10,7 @@ checksum = "5454cda0d57db59778608d7a47bff5b16c6705598265869fb052b657f66cf05e"
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -18,18 +18,14 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
]
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",
diff --git a/mingling_core/tests/test-repl/Cargo.lock b/mingling_core/tests/test-repl/Cargo.lock
index fa22fcf..c26e610 100644
--- a/mingling_core/tests/test-repl/Cargo.lock
+++ b/mingling_core/tests/test-repl/Cargo.lock
@@ -10,7 +10,7 @@ checksum = "5454cda0d57db59778608d7a47bff5b16c6705598265869fb052b657f66cf05e"
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -18,18 +18,14 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
]
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",
diff --git a/mingling_core/tests/test-structural-renderer/Cargo.lock b/mingling_core/tests/test-structural-renderer/Cargo.lock
index 33cb0f4..1a015f8 100644
--- a/mingling_core/tests/test-structural-renderer/Cargo.lock
+++ b/mingling_core/tests/test-structural-renderer/Cargo.lock
@@ -53,7 +53,7 @@ checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
[[package]]
name = "mingling"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"mingling_core",
"mingling_macros",
@@ -63,9 +63,7 @@ dependencies = [
[[package]]
name = "mingling_core"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8574549fae598e8056016c1760d85bdb962a60228d31b3a00bcdd37a40eabfde"
+version = "0.2.1"
dependencies = [
"just_fmt",
"ron",
@@ -77,9 +75,7 @@ dependencies = [
[[package]]
name = "mingling_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "083f1190c65174044c59814ccd12dcb4620085c325fcfa4f3b364943ec2cbe07"
+version = "0.2.1"
dependencies = [
"just_fmt",
"proc-macro2",