Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dep): bump the test-deps group across 1 directory with 2 updates #552

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions crates/rsonpath-test-codegen/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/rsonpath-test-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ rust-version = "1.70.0"
publish = false

[dependencies]
serde = { version = "1.0.210", features = ["derive"] }
serde = { version = "1.0.213", features = ["derive"] }
toml = "0.8.19"
proc-macro2 = "1.0.86"
proc-macro2 = "1.0.89"
quote = "1.0.37"
heck = { version = "0.5.0" }
walkdir = "2.5.0"
Expand Down
41 changes: 20 additions & 21 deletions crates/rsonpath-test-codegen/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Type definitions and serde support for the TOML configuration files.
use std::{cmp, error::Error, fmt::Display, path::PathBuf};

use quote::TokenStreamExt;
use serde::{Deserialize, Serialize};
use std::{cmp, error::Error, fmt::Display, path::PathBuf};

/// Top-level test configuration.
#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down Expand Up @@ -128,35 +126,36 @@ impl<'de> Deserialize<'de> for ResultSpan {

impl quote::ToTokens for ResultApproximateSpan {
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
use proc_macro2::{Ident, Punct, Spacing, Span};
tokens.append(Punct::new('(', Spacing::Alone));
self.start.to_tokens(tokens);
tokens.append(Punct::new(',', Spacing::Alone));
self.end_lower_bound.to_tokens(tokens);
tokens.append(Punct::new(',', Spacing::Alone));
use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream};
let mut outer_group = TokenStream::new();

self.start.to_tokens(&mut outer_group);
Punct::new(',', Spacing::Alone).to_tokens(&mut outer_group);
self.end_lower_bound.to_tokens(&mut outer_group);
Punct::new(',', Spacing::Alone).to_tokens(&mut outer_group);

match self.end_upper_bound {
Some(x) => {
tokens.append(Ident::new("Some", Span::call_site()));
tokens.append(Punct::new('(', Spacing::Alone));
x.to_tokens(tokens);
tokens.append(Punct::new(')', Spacing::Alone));
Ident::new("Some", Span::call_site()).to_tokens(&mut outer_group);
Group::new(Delimiter::Parenthesis, x.to_token_stream()).to_tokens(&mut outer_group);
}
None => tokens.append(Ident::new("None", Span::call_site())),
None => Ident::new("None", Span::call_site()).to_tokens(&mut outer_group),
}

tokens.append(Punct::new(')', Spacing::Alone));
Group::new(Delimiter::Parenthesis, outer_group).to_tokens(tokens);
}
}

impl quote::ToTokens for ResultSpan {
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
use proc_macro2::{Punct, Spacing};
tokens.append(Punct::new('(', Spacing::Alone));
self.start.to_tokens(tokens);
tokens.append(Punct::new(',', Spacing::Alone));
self.end.to_tokens(tokens);
tokens.append(Punct::new(')', Spacing::Alone));
use proc_macro2::{Delimiter, Group, Punct, Spacing, TokenStream};
let mut group = TokenStream::new();

self.start.to_tokens(&mut group);
Punct::new(',', Spacing::Alone).to_tokens(&mut group);
self.end.to_tokens(&mut group);

Group::new(Delimiter::Parenthesis, group).to_tokens(tokens);
}
}

Expand Down
Loading