From 957bff6a825be0fad27a9da02aa079698f984cab Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 28 Oct 2024 22:42:16 -0700 Subject: [PATCH] Update to latest deps & fix errors --- Cargo.lock | 78 ++++++++++++++++++++++++++++++++--------------------- Cargo.toml | 6 ++--- src/main.rs | 8 +++--- 3 files changed, 56 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9933b28..911a7a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + [[package]] name = "anstream" version = "0.6.7" @@ -18,9 +27,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" @@ -52,9 +61,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -62,9 +71,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -74,9 +83,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -96,12 +105,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - [[package]] name = "glob" version = "0.3.1" @@ -114,15 +117,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "itertools" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" -dependencies = [ - "either", -] - [[package]] name = "memchr" version = "2.5.0" @@ -145,6 +139,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + [[package]] name = "proc-macro2" version = "1.0.74" @@ -163,6 +163,23 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "sleek" version = "0.3.0" @@ -175,12 +192,13 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "4565f2e36a05369efe8bf4f7fe0b531710c66dd1b339b50eb83f02ec1863a9c1" dependencies = [ - "itertools", "nom", + "once_cell", + "regex", "unicode_categories", ] @@ -203,18 +221,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 7783a76..df329d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/nrempel/sleek" [dependencies] -clap = { version = "4.5.4", features = ["derive", "cargo"] } +clap = { version = "4.5.20", features = ["derive", "cargo"] } glob = "0.3.1" -sqlformat = "0.2.3" -thiserror = "1.0.58" +sqlformat = "0.3.0" +thiserror = "1.0.65" diff --git a/src/main.rs b/src/main.rs index c6ec89a..52286f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,8 +12,9 @@ fn main() { let options = Options::parse(); let format_options = FormatOptions { indent: Indent::Spaces(options.indent_spaces), - uppercase: options.uppercase.unwrap_or(true), + uppercase: options.uppercase, lines_between_queries: options.lines_between_queries, + ignore_case_convert: None, }; let result = || -> Result<(), Error> { @@ -23,7 +24,7 @@ fn main() { let mut input = String::new(); io::stdin().read_to_string(&mut input)?; - let formatted = format(&input, &QueryParams::default(), format_options); + let formatted = format(&input, &QueryParams::default(), &format_options); if options.check { if input != formatted { return Err(Error::Check); @@ -42,7 +43,8 @@ fn main() { let mut input = String::new(); fs::File::open(&path)?.read_to_string(&mut input)?; - let mut formatted = format(&input, &QueryParams::default(), format_options); + let mut formatted = + format(&input, &QueryParams::default(), &format_options); if options.trailing_newline && !formatted.ends_with('\n') { writeln!(&mut formatted)?;