From e9716163595698b2e1edd550089728a842348154 Mon Sep 17 00:00:00 2001 From: bendn Date: Sun, 21 Apr 2024 07:17:04 +0700 Subject: [PATCH 1/2] fixes )};{( and other fun --- Cargo.lock | 63 +++++++++++++------- Cargo.toml | 2 + src/commands/playground/misc_commands.rs | 15 ++++- src/commands/playground/play_eval.rs | 7 ++- src/commands/playground/util.rs | 76 +++++++++++++++++++----- src/main.rs | 10 +++- 6 files changed, 130 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdf12b1..9b61adc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,14 +16,15 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -81,7 +82,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -92,7 +93,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -566,6 +567,7 @@ dependencies = [ "imageproc", "once_cell", "poise", + "quote", "rand 0.8.5", "reqwest", "rusttype", @@ -576,6 +578,7 @@ dependencies = [ "shuttle-secrets", "shuttle-shared-db", "sqlx", + "syn 2.0.60", "tokio", "tracing", ] @@ -704,7 +707,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -1488,7 +1491,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -1694,7 +1697,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -1812,9 +1815,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -1853,9 +1856,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2272,7 +2275,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -2381,7 +2384,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -2884,9 +2887,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2930,7 +2933,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -3033,7 +3036,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -3186,7 +3189,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", ] [[package]] @@ -3455,7 +3458,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -3489,7 +3492,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3721,6 +3724,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "zeroize" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index af73e72..2ab26e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,3 +27,5 @@ once_cell = "1.13" humantime = "2.1.0" rand = "0.8.5" chrono = "0.4.26" +syn = { version = "2.0.60", features = ["full"] } +quote = "1.0.36" diff --git a/src/commands/playground/misc_commands.rs b/src/commands/playground/misc_commands.rs index c9e9ff4..7f804d8 100644 --- a/src/commands/playground/misc_commands.rs +++ b/src/commands/playground/misc_commands.rs @@ -20,8 +20,12 @@ pub async fn miri( code: poise::CodeBlock, ) -> Result<(), Error> { ctx.say(stub_message(ctx)).await?; - - let code = &maybe_wrap(&code.code, ResultHandling::Discard); + let code = &maybe_wrapped( + &code.code, + ResultHandling::Discard, + ctx.prefix().contains("sweat"), + ctx.prefix().contains("owo"), + ); let (flags, flag_parse_errors) = parse_flags(flags); let mut result: PlayResult = ctx @@ -142,7 +146,12 @@ pub async fn clippy( // dead_code: https://github.com/kangalioo/rustbot/issues/44 // let_unit_value: silence warning about `let _ = { ... }` wrapper that swallows return val "#![allow(dead_code, clippy::let_unit_value)] {}", - maybe_wrap(&code.code, ResultHandling::Discard) + maybe_wrapped( + &code.code, + ResultHandling::Discard, + ctx.prefix().contains("sweat"), + false, + ) ); let (flags, flag_parse_errors) = parse_flags(flags); diff --git a/src/commands/playground/play_eval.rs b/src/commands/playground/play_eval.rs index 3bcd3bc..87c812e 100644 --- a/src/commands/playground/play_eval.rs +++ b/src/commands/playground/play_eval.rs @@ -14,7 +14,12 @@ async fn play_or_eval( ) -> Result<(), Error> { ctx.say(stub_message(ctx)).await?; - let code = maybe_wrap(&code.code, result_handling); + let code = maybe_wrapped( + &code.code, + result_handling, + ctx.prefix().contains("sweat"), + ctx.prefix().contains("owo"), + ); let (mut flags, flag_parse_errors) = parse_flags(flags); if force_warnings { diff --git a/src/commands/playground/util.rs b/src/commands/playground/util.rs index d6b3ac5..dec2867 100644 --- a/src/commands/playground/util.rs +++ b/src/commands/playground/util.rs @@ -198,26 +198,69 @@ pub fn hoise_crate_attributes(code: &str, after_crate_attrs: &str, after_code: & /// Utility used by the commands to wrap the given code in a `fn main` if not already wrapped. /// To check, whether a wrap was done, check if the return type is Cow::Borrowed vs Cow::Owned /// If a wrap was done, also hoists crate attributes to the top so they keep working -pub fn maybe_wrap(code: &str, result_handling: ResultHandling) -> Cow<'_, str> { - if code.contains("fn main") || code.contains("#![no_main]") { - return Cow::Borrowed(code); +pub fn maybe_wrap(code: &str, result_handling: ResultHandling) -> Cow { + maybe_wrapped(code, result_handling, false, false) +} + +pub fn maybe_wrapped( + code: &str, + result_handling: ResultHandling, + unsf: bool, + pretty: bool, +) -> Cow { + use quote::quote; + use syn::{parse::Parse, *}; + + struct Inline { + attrs: Vec, + stmts: Vec, } - // fn main boilerplate - let after_crate_attrs = match result_handling { - ResultHandling::None => "fn main() {\n", - ResultHandling::Discard => "fn main() { let _ = {\n", - ResultHandling::Print => "fn main() { println!(\"{:?}\", {\n", - }; + impl Parse for Inline { + fn parse(input: parse::ParseStream) -> Result { + let attrs = Attribute::parse_inner(input)?; + let stmts = Block::parse_within(input)?; + for stmt in &stmts { + if let Stmt::Item(Item::Fn(ItemFn { sig, .. })) = stmt { + if sig.ident.to_string() == "main" && sig.inputs.len() == 0 { + return Err(input.error("main")); + } + } + } + Ok(Self { attrs, stmts }) + } + } - // fn main boilerplate counterpart - let after_code = match result_handling { - ResultHandling::None => "}", - ResultHandling::Discard => "}; }", - ResultHandling::Print => "}); }", + let Ok(Inline { attrs, mut stmts }) = parse_str::(code) else { + return Cow::Borrowed(code); }; - - Cow::Owned(hoise_crate_attributes(code, after_crate_attrs, after_code)) + if unsf { + stmts = vec![Stmt::Expr( + Expr::Unsafe(ExprUnsafe { + attrs: vec![], + unsafe_token: syn::token::Unsafe::default(), + block: Block { + brace_token: syn::token::Brace::default(), + stmts, + }, + }), + None, + )]; + } + match result_handling { + ResultHandling::None => quote! { #(#attrs)* fn main() { #(#stmts)* } }, + ResultHandling::Discard => { + quote! { #(#attrs)* fn main() { _ = (|| { #(#stmts)* })() } } + } + ResultHandling::Print if pretty => { + quote! { #(#attrs)* fn main() { ::std::println!("{:#?}", (|| { #(#stmts)* })()) } } + } + ResultHandling::Print => { + quote! { #(#attrs)* fn main() { ::std::println!("{:?}", (|| { #(#stmts)* })()) } } + } + } + .to_string() + .into() } /// Send a Discord reply with the formatted contents of a Playground result @@ -362,6 +405,7 @@ pub fn format_play_eval_stderr(stderr: &str, show_compiler_warnings: bool) -> St } else { program_stderr.to_owned() } + .replace('`', "\u{200b}`") } else { // Program didn't get to run, so there must be an error, so we yield the compiler output // regardless of whether warn is enabled or not diff --git a/src/main.rs b/src/main.rs index bfc9d00..13ce438 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,10 +81,14 @@ async fn poise(#[shuttle_secrets::Secrets] secret_store: SecretStore) -> Shuttle poise::Prefix::Literal("🦀"), poise::Prefix::Literal("<:ferris:358652670585733120> "), poise::Prefix::Literal("<:ferris:358652670585733120>"), - poise::Prefix::Literal("<:ferrisballSweat:678714352450142239> "), - poise::Prefix::Literal("<:ferrisballSweat:678714352450142239>"), + poise::Prefix::Literal("<:sweat:678714352450142239> "), + poise::Prefix::Literal("<:sweat:678714352450142239>"), + poise::Prefix::Literal("<:owo:678714352450142239> "), + poise::Prefix::Literal("<:owo:678714352450142239>"), + poise::Prefix::Literal("<:owo:579331467000283136> "), + poise::Prefix::Literal("<:owo:579331467000283136>"), poise::Prefix::Regex( - "(yo|hey) (crab|ferris|fewwis),? can you (please |pwease )?" + "(yo |hey )?(crab|ferris|fewwis),? can you (please |pwease )?" .parse() .unwrap(), ), From 6bfac15d34f29f3d1a3a405351f9f6211aaac4a1 Mon Sep 17 00:00:00 2001 From: bendn Date: Wed, 1 May 2024 09:02:41 +0700 Subject: [PATCH 2/2] fix --- Cargo.lock | 149 +++++++++++++++++++++------------------------------- src/main.rs | 2 +- 2 files changed, 62 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7120ef3..405de5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,22 +123,6 @@ dependencies = [ "syn 2.0.60", ] -[[package]] -name = "async-tungstenite" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b71b31561643aa8e7df3effe284fa83ab1a840e52294c5f4bd7bfd8b2becbb" -dependencies = [ - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "tokio", - "tokio-rustls 0.23.4", - "tungstenite", - "webpki-roots", -] - [[package]] name = "atoi" version = "2.0.0" @@ -313,9 +297,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" [[package]] name = "cfg-if" @@ -553,7 +537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -562,9 +546,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -731,9 +715,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -778,9 +762,9 @@ checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1006,9 +990,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1020,7 +1004,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1155,7 +1139,7 @@ dependencies = [ "futures-util", "http 0.2.12", "hyper", - "rustls 0.21.11", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] @@ -1258,7 +1242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1311,9 +1295,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libm" @@ -1340,9 +1324,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1749,9 +1733,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -1759,15 +1743,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -2131,6 +2115,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" version = "1.10.4" @@ -2199,7 +2192,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.11", + "rustls 0.21.12", "rustls-pemfile", "serde", "serde_json", @@ -2262,9 +2255,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -2275,9 +2268,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -2294,7 +2287,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "subtle", "zeroize", ] @@ -2310,9 +2303,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] name = "rustls-webpki" @@ -2326,9 +2319,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring", "rustls-pki-types", @@ -2454,18 +2447,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", @@ -2693,9 +2686,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2767,9 +2760,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3291,7 +3284,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.11", + "rustls 0.21.12", "tokio", ] @@ -3558,7 +3551,7 @@ checksum = "eb704842c709bc76f63e99e704cb208beeccca2abbabd0d9aec02e48ca1cee0f" dependencies = [ "chrono", "dashmap", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "mini-moka", "parking_lot", "secrecy", @@ -3617,9 +3610,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode_categories" @@ -3842,16 +3835,16 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "redox_syscall", + "redox_syscall 0.4.1", "wasite", "web-sys", ] [[package]] name = "wide" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a1851a719f11d1d2fea40e15c72f6c00de8c142d7ac47c1441cc7e4d0d5bc6" +checksum = "0f0e39d2c603fdc0504b12b458cf1f34e0b937ed2f4f2dc20796e3e86f34e11f" dependencies = [ "bytemuck", "safe_arch", @@ -3875,11 +3868,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4066,26 +4059,6 @@ dependencies = [ "syn 2.0.60", ] -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "zeroize" version = "1.7.0" diff --git a/src/main.rs b/src/main.rs index fcca073..515079b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -116,7 +116,7 @@ or code here `\x1b[0m`\x1b[0m` ```" - .to_owned() + .to_owned() } else if let Some(multiline_help) = &ctx.command().help_text { format!("**{}**\n{}", error, multiline_help) } else {