From 3e8d001f5c9be10e4bb680a1d409326902c96c10 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Sun, 11 Aug 2024 17:12:26 +0800 Subject: [PATCH] Update to rust 1.80 (#1089) --- Cargo.lock | 8 ++++---- crates/filter/src/sequential_worker.rs | 2 +- crates/maple_config/doc_gen/src/main.rs | 15 +++++++++------ crates/maple_config/src/lib.rs | 2 +- crates/maple_core/src/stdio_server/plugin/mod.rs | 2 ++ crates/maple_derive/tests/tests.rs | 1 + crates/printer/src/trimmer/v0.rs | 2 +- crates/printer/src/truncation.rs | 2 +- rust-toolchain.toml | 2 +- 9 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85ce29575..e089a2f24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2843,9 +2843,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2864,9 +2864,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/crates/filter/src/sequential_worker.rs b/crates/filter/src/sequential_worker.rs index 2fb15871b..0d13fd827 100644 --- a/crates/filter/src/sequential_worker.rs +++ b/crates/filter/src/sequential_worker.rs @@ -448,7 +448,7 @@ mod tests { item }) - .take(usize::max_value() >> 8), + .take(usize::MAX >> 8), ), ) .unwrap() diff --git a/crates/maple_config/doc_gen/src/main.rs b/crates/maple_config/doc_gen/src/main.rs index f3fbd4d28..797bd6cb0 100644 --- a/crates/maple_config/doc_gen/src/main.rs +++ b/crates/maple_config/doc_gen/src/main.rs @@ -99,12 +99,15 @@ impl FieldInfo { } fn extract_doc_comment(attr: &Attribute) -> Option { - if let Ok(MetaNameValue { path, value, .. }) = attr.meta.require_name_value() { - if let Expr::Lit(expr_lit) = value { - if let Lit::Str(comment) = &expr_lit.lit { - if path.is_ident("doc") { - return Some(comment.value()); - } + if let Ok(MetaNameValue { + path, + value: Expr::Lit(expr_lit), + .. + }) = attr.meta.require_name_value() + { + if let Lit::Str(comment) = &expr_lit.lit { + if path.is_ident("doc") { + return Some(comment.value()); } } } diff --git a/crates/maple_config/src/lib.rs b/crates/maple_config/src/lib.rs index a76dbe32d..e0dfeee14 100644 --- a/crates/maple_config/src/lib.rs +++ b/crates/maple_config/src/lib.rs @@ -458,7 +458,7 @@ pub struct SyntaxPluginConfig { /// Possible values: /// - `visual-lines`: Always render the visual lines only. /// - `entire-buffer-up-to-limit`: Render the entire buffer until - /// the buffer size exceeds the size limit (in bytes). + /// the buffer size exceeds the size limit (in bytes). /// /// # Example /// diff --git a/crates/maple_core/src/stdio_server/plugin/mod.rs b/crates/maple_core/src/stdio_server/plugin/mod.rs index 511061ac6..f7e58e21f 100644 --- a/crates/maple_core/src/stdio_server/plugin/mod.rs +++ b/crates/maple_core/src/stdio_server/plugin/mod.rs @@ -126,10 +126,12 @@ pub trait ClapPlugin: ClapAction + Debug + Send + Sync + 'static { mod tests { #[derive(maple_derive::ClapPlugin)] #[clap_plugin(id = "plugin", actions = ["action1", "action2"])] + #[allow(dead_code)] struct TestPlugin; #[derive(maple_derive::ClapPlugin)] #[clap_plugin(id = "empty")] + #[allow(dead_code)] struct EmptyPlugin; #[test] diff --git a/crates/maple_derive/tests/tests.rs b/crates/maple_derive/tests/tests.rs index 72d1f4263..243d6a4f4 100644 --- a/crates/maple_derive/tests/tests.rs +++ b/crates/maple_derive/tests/tests.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] use types::AutocmdEventType; #[async_trait::async_trait] diff --git a/crates/printer/src/trimmer/v0.rs b/crates/printer/src/trimmer/v0.rs index c898352cd..08723c62e 100644 --- a/crates/printer/src/trimmer/v0.rs +++ b/crates/printer/src/trimmer/v0.rs @@ -4,7 +4,7 @@ //! 1. `let g:clap_force_python = 1`. //! 2. open https://github.com/subspace/subspace/blob/c50bec907ab8ade923a2a0b4888f43bfc47e8a7f/polkadot/node/collation-generation/src/lib.rs //! 3. Type `sr` and then you'll see Neovim hang forever, have no idea&time to fix it -//! properly therefore the old implementation are just kept. +//! properly therefore the old implementation are just kept. use super::AsciiDots; diff --git a/crates/printer/src/truncation.rs b/crates/printer/src/truncation.rs index 5b4458fb7..0d265b810 100644 --- a/crates/printer/src/truncation.rs +++ b/crates/printer/src/truncation.rs @@ -261,7 +261,7 @@ mod tests { fn test_grep_print() { // GrepResult { matched_item: MatchedItem { item: "crates/maple_core/src/paths.rs:198:31:let expected = \"~/.rustup/.../src/rust/library/alloc/src/string.rs\";", rank: [874, -30, -68, 0], indices: [68, 69, 77, 91, 92], display_text: None, output_text: None }, path: "/home/xlc/.vim/plugged/vim-clap/crates/maple_core/src/paths.rs", line_number: 198, line_number_start: 32, line_number_end: 35, column: 31, column_start: 36, column_end: 38 }, winwidth: 62, icon: Enabled(Grep) let line = r#"crates/maple_core/src/paths.rs:198:31:let expected = "~/.rustup/.../src/rust/library/alloc/src/string.rs";"#; - let mut items = vec![GrepResult { + let mut items = [GrepResult { matched_item: MatchedItem::new( Arc::new(line.to_string()) as Arc, [874, -30, -68, 0], diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fcc85b9ec..8cca5be05 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.77" +channel = "1.80"