From 3fe284250b7a7330f9d397a383634c16e056b055 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 27 Dec 2024 18:02:34 -0500 Subject: [PATCH] chore: update deno_path_util (#684) --- .github/workflows/ci.yml | 30 +++++++------- Cargo.lock | 85 ++++++++++++++++++++++++++++++++++++---- Cargo.toml | 4 +- rust-toolchain.toml | 2 +- src/diagnostics.rs | 2 +- src/html/comrak.rs | 2 +- src/printer.rs | 4 +- src/tests.rs | 18 ++++----- 8 files changed, 109 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f00414b0..f04ad7c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,18 +85,18 @@ jobs: if: contains(matrix.os, 'ubuntu') run: cd js && deno run -A jsr:@david/publish-on-tag@0.1.3 --allow-dirty - - name: Install cargo-llvm-cov - if: contains(matrix.os, 'ubuntu') - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Generate code coverage - if: contains(matrix.os, 'ubuntu') - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload coverage to Codecov - if: contains(matrix.os, 'ubuntu') - uses: codecov/codecov-action@v3 - with: - files: lcov.info - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} + # - name: Install cargo-llvm-cov + # if: contains(matrix.os, 'ubuntu') + # uses: taiki-e/install-action@cargo-llvm-cov + + # - name: Generate code coverage + # if: contains(matrix.os, 'ubuntu') + # run: cargo llvm-cov --lcov --output-path lcov.info + + # - name: Upload coverage to Codecov + # if: contains(matrix.os, 'ubuntu') + # uses: codecov/codecov-action@v3 + # with: + # files: lcov.info + # fail_ci_if_error: true + # token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 0c6966cc..a252ce52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,6 +208,28 @@ version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +[[package]] +name = "capacity_builder" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f2d24a6dcf0cd402a21b65d35340f3a49ff3475dc5fdac91d22d2733e6641c6" +dependencies = [ + "capacity_builder_macros", + "ecow", + "hipstr", + "itoa", +] + +[[package]] +name = "capacity_builder_macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b4a6cae9efc04cc6cbb8faf338d2c497c165c83e74509cf4dbedea948bbf6e5" +dependencies = [ + "quote", + "syn 2.0.89", +] + [[package]] name = "caseless" version = "0.2.1" @@ -613,14 +635,16 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.86.3" +version = "0.86.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc78ed0b4bbcb4197300f0d6e7d1edc2d2c5019cdb9dedba7ff229158441885b" +checksum = "83af194ca492ea7b624d21055f933676d3f3d27586de93be31c8f1babcc73510" dependencies = [ "anyhow", "async-trait", + "capacity_builder", "data-url", "deno_ast", + "deno_path_util", "deno_semver", "deno_unsync", "encoding_rs", @@ -635,6 +659,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "sys_traits", "thiserror 2.0.3", "url", "wasm_dep_analyzer", @@ -653,22 +678,27 @@ dependencies = [ [[package]] name = "deno_path_util" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff25f6e08e7a0214bbacdd6f7195c7f1ebcd850c87a624e4ff06326b68b42d99" +checksum = "420e8211aaba7fde83ccaa9a5dad855c3b940ed988d70c95159acd600a70dc87" dependencies = [ + "deno_error", "percent-encoding", - "thiserror 1.0.64", + "sys_traits", + "thiserror 2.0.3", "url", ] [[package]] name = "deno_semver" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756be7351289726087408984db18b9eb5e0186907673f39f858d119d0162071" +checksum = "4775271f9b5602482698f76d24ea9ed8ba27af7f587a7e9a876916300c542435" dependencies = [ + "capacity_builder", "deno_error", + "ecow", + "hipstr", "monch", "once_cell", "serde", @@ -785,6 +815,15 @@ dependencies = [ "text_lines", ] +[[package]] +name = "ecow" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42fc0a93992b20c58b99e59d61eaf1635a25bfbe49e4275c34ba0aee98119ba" +dependencies = [ + "serde", +] + [[package]] name = "either" version = "1.13.0" @@ -1037,6 +1076,17 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hipstr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97971ffc85d4c98de12e2608e992a43f5294ebb625fdb045b27c731b64c4c6d6" +dependencies = [ + "serde", + "serde_bytes", + "sptr", +] + [[package]] name = "hstr" version = "0.2.12" @@ -1834,6 +1884,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.210" @@ -1964,6 +2023,12 @@ dependencies = [ "url", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2285,6 +2350,12 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "sys_traits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72001c0d1b690f17bb18ea7960821389199fd59ce6784f883fc76d0f3fbb6236" + [[package]] name = "tap" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 46f7a99f..67585e0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/denoland/deno_doc" members = ["lib"] [workspace.dependencies] -deno_graph = { version = "0.86.3", default-features = false, features = ["symbols"] } +deno_graph = { version = "0.86.6", default-features = false, features = ["symbols"] } deno_ast = { version = "0.44.0" } import_map = "0.20.0" serde = { version = "1.0.204", features = ["derive"] } @@ -38,7 +38,7 @@ serde.workspace = true serde_json = { version = "1.0.122", features = ["preserve_order"] } termcolor = "1.4.1" itoa = "1.0.14" -deno_path_util = "0.2.1" +deno_path_util = "0.3.0" html-escape = { version = "0.2.13" } handlebars = { version = "6.1", features = ["string_helpers"] } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 85cb9e7b..80afd2d3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.80.0" +channel = "1.83.0" components = ["rustfmt", "clippy"] diff --git a/src/diagnostics.rs b/src/diagnostics.rs index 254debc2..52839a77 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -363,7 +363,7 @@ struct DiagnosticDocNodeVisitor<'a, 'b> { diagnostics: &'a mut DiagnosticsCollector<'b>, } -impl<'a, 'b> DiagnosticDocNodeVisitor<'a, 'b> { +impl DiagnosticDocNodeVisitor<'_, '_> { pub fn visit_doc_nodes<'c, I>(&'c mut self, doc_nodes: I) where I: Iterator, diff --git a/src/html/comrak.rs b/src/html/comrak.rs index 9b3bbdbe..33b9a3e5 100644 --- a/src/html/comrak.rs +++ b/src/html/comrak.rs @@ -94,7 +94,7 @@ pub fn strip(md: &str) -> String { output.write_all(literal.as_bytes()).unwrap(); } NodeValue::LineBreak | NodeValue::SoftBreak => { - output.write_all(&[b' ']).unwrap() + output.write_all(b" ").unwrap() } _ => { for n in node.children() { diff --git a/src/printer.rs b/src/printer.rs index 21fb8192..cc7fb952 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -28,7 +28,7 @@ pub struct DocPrinter<'a> { private: bool, } -impl<'a> DocPrinter<'a> { +impl DocPrinter<'_> { pub fn new( doc_nodes: &[DocNode], use_color: bool, @@ -766,7 +766,7 @@ impl<'a> DocPrinter<'a> { } } -impl<'a> Display for DocPrinter<'a> { +impl Display for DocPrinter<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { self.format(f) } diff --git a/src/tests.rs b/src/tests.rs index d8b02778..09cb992a 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -627,45 +627,45 @@ export namespace Deno { // Namespace let found = find_nodes_by_name_recursively(entries.clone(), "Deno"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "Deno".into()); + assert_eq!(found[0].name.as_ref(), "Deno"); // Overloaded functions let found = find_nodes_by_name_recursively(entries.clone(), "Deno.test"); assert_eq!(found.len(), 3); - assert_eq!(found[0].name, "test".into()); - assert_eq!(found[1].name, "test".into()); - assert_eq!(found[2].name, "test".into()); + assert_eq!(found[0].name.as_ref(), "test"); + assert_eq!(found[1].name.as_ref(), "test"); + assert_eq!(found[2].name.as_ref(), "test"); // Nested namespace let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Inner.a"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "a".into()); + assert_eq!(found[0].name.as_ref(), "a"); // Interface property let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Conn.rid"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "rid".into()); + assert_eq!(found[0].name.as_ref(), "rid"); assert_eq!(found[0].kind(), DocNodeKind::Variable); // Interface method let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Conn.closeWrite"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "closeWrite".into()); + assert_eq!(found[0].name.as_ref(), "closeWrite"); assert_eq!(found[0].kind(), DocNodeKind::Function); // Class property let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Process.pid"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "pid".into()); + assert_eq!(found[0].name.as_ref(), "pid"); assert_eq!(found[0].kind(), DocNodeKind::Variable); // Class method let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Process.output"); assert_eq!(found.len(), 1); - assert_eq!(found[0].name, "output".into()); + assert_eq!(found[0].name.as_ref(), "output"); assert_eq!(found[0].kind(), DocNodeKind::Function); // No match