Skip to content

Commit f3ac15c

Browse files
committed
Bump dependencies, remove unused nom dependency from spdlog-macros
1 parent 5c6d905 commit f3ac15c

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

spdlog-internal/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["spdlog", "log", "logging"]
1111
categories = ["development-tools::debugging"]
1212

1313
[dependencies]
14-
nom = "7.1.3"
15-
strum = { version = "0.24.1", features = ["derive"] }
16-
strum_macros = "0.24.3"
17-
thiserror = "1.0.40"
14+
nom = "8.0.0"
15+
strum = { version = "0.27.0", features = ["derive"] }
16+
strum_macros = "0.27.0"
17+
thiserror = "2.0.0"

spdlog-internal/src/pattern_parser/helper.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub(crate) fn take_until_unbalanced(
5555

5656
#[cfg(test)]
5757
mod tests {
58-
use nom::{bytes::complete::tag, error::ErrorKind, sequence::delimited};
58+
use nom::{bytes::complete::tag, error::ErrorKind, sequence::delimited, Parser};
5959

6060
use super::*;
6161

@@ -98,6 +98,9 @@ mod tests {
9898
#[test]
9999
fn take_until_basic_usage() {
100100
let mut parser = delimited(tag("<"), take_until_unbalanced('<', '>'), tag(">"));
101-
assert_eq!(parser("<<inside>inside>abc"), Ok(("abc", "<inside>inside")));
101+
assert_eq!(
102+
parser.parse("<<inside>inside>abc"),
103+
Ok(("abc", "<inside>inside"))
104+
);
102105
}
103106
}

spdlog-internal/src/pattern_parser/parse.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ impl<'a> Template<'a> {
2626

2727
impl<'a> Template<'a> {
2828
#[must_use]
29-
fn parser() -> impl Parser<&'a str, Template<'a>, NomError<&'a str>> {
29+
fn parser() -> impl Parser<&'a str, Output = Template<'a>, Error = NomError<&'a str>> {
3030
let token_parser = TemplateToken::parser();
3131
nom::combinator::complete(nom::multi::many0(token_parser).and(nom::combinator::eof))
3232
.map(|(tokens, _)| Self { tokens })
3333
}
3434

3535
#[must_use]
36-
fn parser_without_style_range() -> impl Parser<&'a str, Template<'a>, NomError<&'a str>> {
36+
fn parser_without_style_range(
37+
) -> impl Parser<&'a str, Output = Template<'a>, Error = NomError<&'a str>> {
3738
let token_parser = TemplateToken::parser_without_style_range();
3839
nom::combinator::complete(nom::multi::many0(token_parser).and(nom::combinator::eof))
3940
.map(|(tokens, _)| Self { tokens })
@@ -49,15 +50,16 @@ pub enum TemplateToken<'a> {
4950

5051
impl<'a> TemplateToken<'a> {
5152
#[must_use]
52-
fn parser() -> impl Parser<&'a str, TemplateToken<'a>, NomError<&'a str>> {
53+
fn parser() -> impl Parser<&'a str, Output = TemplateToken<'a>, Error = NomError<&'a str>> {
5354
let style_range_parser = TemplateStyleRange::parser();
5455
let other_parser = Self::parser_without_style_range();
5556

5657
nom::combinator::map(style_range_parser, Self::StyleRange).or(other_parser)
5758
}
5859

5960
#[must_use]
60-
fn parser_without_style_range() -> impl Parser<&'a str, TemplateToken<'a>, NomError<&'a str>> {
61+
fn parser_without_style_range(
62+
) -> impl Parser<&'a str, Output = TemplateToken<'a>, Error = NomError<&'a str>> {
6163
let literal_parser = TemplateLiteral::parser();
6264
let formatter_parser = TemplateFormatterToken::parser();
6365

@@ -73,7 +75,7 @@ pub struct TemplateLiteral {
7375

7476
impl TemplateLiteral {
7577
#[must_use]
76-
fn parser<'a>() -> impl Parser<&'a str, Self, NomError<&'a str>> {
78+
fn parser<'a>() -> impl Parser<&'a str, Output = Self, Error = NomError<&'a str>> {
7779
let literal_char_parser = nom::combinator::value('{', nom::bytes::complete::tag("{{"))
7880
.or(nom::combinator::value('}', nom::bytes::complete::tag("}}")))
7981
.or(nom::character::complete::none_of("{"));
@@ -91,11 +93,12 @@ pub struct TemplateFormatterToken<'a> {
9193

9294
impl<'a> TemplateFormatterToken<'a> {
9395
#[must_use]
94-
fn parser() -> impl Parser<&'a str, TemplateFormatterToken<'a>, NomError<&'a str>> {
96+
fn parser(
97+
) -> impl Parser<&'a str, Output = TemplateFormatterToken<'a>, Error = NomError<&'a str>> {
9598
let open_paren = nom::character::complete::char('{');
9699
let close_paren = nom::character::complete::char('}');
97100
let formatter_prefix = nom::character::complete::char('$');
98-
let formatter_placeholder = nom::combinator::recognize(nom::sequence::tuple((
101+
let formatter_placeholder = nom::combinator::recognize((
99102
nom::combinator::opt(formatter_prefix),
100103
nom::branch::alt((
101104
nom::character::complete::alpha1,
@@ -105,7 +108,7 @@ impl<'a> TemplateFormatterToken<'a> {
105108
nom::character::complete::alphanumeric1,
106109
nom::bytes::complete::tag("_"),
107110
))),
108-
)));
111+
));
109112

110113
nom::sequence::delimited(open_paren, formatter_placeholder, close_paren).map(
111114
move |placeholder: &str| match placeholder.strip_prefix('$') {
@@ -129,7 +132,8 @@ pub struct TemplateStyleRange<'a> {
129132

130133
impl<'a> TemplateStyleRange<'a> {
131134
#[must_use]
132-
fn parser() -> impl Parser<&'a str, TemplateStyleRange<'a>, NomError<&'a str>> {
135+
fn parser() -> impl Parser<&'a str, Output = TemplateStyleRange<'a>, Error = NomError<&'a str>>
136+
{
133137
nom::bytes::complete::tag("{^")
134138
.and(helper::take_until_unbalanced('{', '}'))
135139
.and(nom::bytes::complete::tag("}"))

spdlog-macros/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ categories = ["development-tools::debugging"]
1414
proc-macro = true
1515

1616
[dependencies]
17-
nom = "7.1.1"
1817
proc-macro2 = "1.0.47"
1918
quote = "1.0.21"
2019
spdlog-internal = { version = "=0.1.0", path = "../spdlog-internal" }

spdlog/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ serde = { version = "1.0.163", optional = true, features = ["derive"] }
5757
serde_json = { version = "1.0.120", optional = true }
5858
spdlog-internal = { version = "=0.1.0", path = "../spdlog-internal", optional = true }
5959
spdlog-macros = { version = "=0.2.0", path = "../spdlog-macros" }
60-
thiserror = "1.0.37"
60+
thiserror = "2.0.0"
6161
value-bag = { version = "1.11.1", features = ["owned", "inline-i128"] }
6262

6363
[target.'cfg(windows)'.dependencies]
@@ -73,7 +73,7 @@ libsystemd-sys = { version = "0.9.3", optional = true }
7373
android_log-sys = { version = "0.3.0", optional = true }
7474

7575
[dev-dependencies]
76-
clap = { version = "3.2.23", features = ["derive"] }
76+
clap = { version = "4.5.48", features = ["derive"] }
7777
crossbeam = "0.8.2"
7878
regex = "1.7.0"
7979
paste = "1.0.14"

spdlog/benches/spdlog-rs/compare_with_cpp_spdlog_async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct Args {
111111

112112
/// Number of the channel capacity
113113
/// [default: `min(message_count + 2, 8192)`]
114-
#[clap(long, validator(arg_queue_size_validator))]
114+
#[clap(long, value_parser(arg_queue_size_validator))]
115115
queue_size: Option<usize>,
116116

117117
/// Number of the benchmark threads

0 commit comments

Comments
 (0)