From a41401cb570027718101a70bf205211709426dda Mon Sep 17 00:00:00 2001 From: Vladimir Motylenko Date: Sat, 13 May 2023 19:14:41 +0300 Subject: [PATCH] Release: Cleanup release. --- Cargo.toml | 2 +- benches/bench.rs | 2 +- examples/html-to-string-macro/src/lib.rs | 2 +- examples/html-to-string-macro/tests/tests.rs | 8 +++++--- src/node/raw_text.rs | 4 ++-- tests/recoverable_parser.rs | 2 +- tests/test.rs | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f838798..bfd33a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rstml" description = "Rust templating parser for JSX-like TokenStreams" -version = "0.10.0" +version = "0.10.1" authors = ["vldm ","stoically "] keywords = ["syn", "jsx", "rsx", "html", "macro"] edition = "2018" diff --git a/benches/bench.rs b/benches/bench.rs index 5226559..e893885 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -43,7 +43,7 @@ fn criterion_benchmark(c: &mut Criterion) { .into_iter() .collect(), ); - rstml::parse2_with_config(RUST_SITE_SIMPLE.with(|tokens|tokens.clone()), config) + rstml::parse2_with_config(RUST_SITE_SIMPLE.with(|tokens| tokens.clone()), config) }) }); } diff --git a/examples/html-to-string-macro/src/lib.rs b/examples/html-to-string-macro/src/lib.rs index 015d274..3cce557 100644 --- a/examples/html-to-string-macro/src/lib.rs +++ b/examples/html-to-string-macro/src/lib.rs @@ -3,8 +3,8 @@ use std::collections::HashSet; use proc_macro::TokenStream; use proc_macro2::{Literal, TokenTree}; use quote::{quote, quote_spanned, ToTokens}; -use syn::spanned::Spanned; use rstml::{Node, NodeAttribute, NodeName, Parser, ParserConfig}; +use syn::spanned::Spanned; #[derive(Default)] struct WalkNodesOutput<'a> { diff --git a/examples/html-to-string-macro/tests/tests.rs b/examples/html-to-string-macro/tests/tests.rs index 68f8e6a..a148b27 100644 --- a/examples/html-to-string-macro/tests/tests.rs +++ b/examples/html-to-string-macro/tests/tests.rs @@ -9,7 +9,6 @@ pub mod docs { } #[test] fn test() { - let nightly_unqoted = " Hello world with spaces "; let stable_unqoted = "Hello world with spaces"; let unquoted_text = if cfg!(feature = "nightly") { @@ -37,7 +36,8 @@ fn test() { }, - format!(r#" + format!( + r#" @@ -52,7 +52,9 @@ fn test() {
- "#, unquoted_text) + "#, + unquoted_text + ) .split('\n') .map(|line| line.trim()) .collect::>() diff --git a/src/node/raw_text.rs b/src/node/raw_text.rs index 4c83fa8..5823f9b 100644 --- a/src/node/raw_text.rs +++ b/src/node/raw_text.rs @@ -67,7 +67,7 @@ impl RawText { /// Return Spans for all unquoted text or nothing. /// Usefull to detect is `Span::join` is available or not. pub fn join_spans(&self) -> Option { - let mut span:Option = None; + let mut span: Option = None; for tt in self.token_stream.clone().into_iter() { let joined = if let Some(span) = span { span.join(tt.span())? @@ -76,7 +76,7 @@ impl RawText { }; span = Some(joined); } - return span + return span; } pub fn is_empty(&self) -> bool { diff --git a/tests/recoverable_parser.rs b/tests/recoverable_parser.rs index 355ed50..69f80eb 100644 --- a/tests/recoverable_parser.rs +++ b/tests/recoverable_parser.rs @@ -3,8 +3,8 @@ use std::{convert::TryFrom, str::FromStr}; use eyre::Result; use proc_macro2::TokenStream; use quote::quote; -use syn::Block; use rstml::{Node, NodeAttribute, NodeBlock, Parser, ParserConfig}; +use syn::Block; #[test] fn test_recover_incorrect_closing_tags() { diff --git a/tests/test.rs b/tests/test.rs index 96f382f..68023a1 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -3,11 +3,11 @@ use std::{convert::TryFrom, str::FromStr}; use eyre::Result; use proc_macro2::TokenStream; use quote::quote; -use syn::Block; use rstml::{ parse2, parse2_with_config, KeyedAttribute, Node, NodeAttribute, NodeElement, NodeType, ParserConfig, }; +use syn::Block; #[test] fn test_single_empty_element() -> Result<()> {