File: newer-cargo-metadata.patch

package info (click to toggle)
rust-cargo-auditable 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: makefile: 2
file content (65 lines) | stat: -rw-r--r-- 2,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Index: cargo-auditable/Cargo.toml
===================================================================
--- cargo-auditable.orig/Cargo.toml
+++ cargo-auditable/Cargo.toml
@@ -48,7 +48,7 @@ path = "tests/it.rs"
 version = "0.9.0"
 
 [dependencies.cargo_metadata]
-version = "0.18"
+version = ">= 0.19, < 0.23"
 
 [dependencies.miniz_oxide]
 version = ">= 0.7, < 0.9"
@@ -79,7 +79,7 @@ version = "0.10.0"
 #features = ["wasm"]
 
 [dev-dependencies.cargo_metadata]
-version = "0.18"
+version = ">= 0.19, < 0.23"
 
 [dev-dependencies.which]
 version = "4.3.0"
Index: cargo-auditable/src/auditable_from_metadata.rs
===================================================================
--- cargo-auditable.orig/src/auditable_from_metadata.rs
+++ cargo-auditable/src/auditable_from_metadata.rs
@@ -186,7 +186,7 @@ pub fn encode_audit_data(
     let mut packages: Vec<Package> = packages
         .into_iter()
         .map(|p| Package {
-            name: p.name.to_owned(),
+            name: p.name.to_string(),
             version: p.version.clone(),
             source: p.source.as_ref().map_or(Source::Local, source_from_meta),
             kind: (*metadata_package_dep_kind(p).unwrap()).into(),
@@ -240,7 +240,7 @@ fn proc_macro_packages(metadata: &cargo_
             // Checking that length is 1 is purely to hedge against support for it being added in the future.
             if pkg.targets.len() == 1
                 && pkg.targets[0].kind.len() == 1
-                && pkg.targets[0].kind[0] == "proc-macro"
+                && pkg.targets[0].kind[0] == "proc-macro".into()
             {
                 Some(pkg.id.repr.as_str())
             } else {
Index: cargo-auditable/tests/it.rs
===================================================================
--- cargo-auditable.orig/tests/it.rs
+++ cargo-auditable/tests/it.rs
@@ -12,6 +12,7 @@ use cargo_metadata::{
     camino::{Utf8Path, Utf8PathBuf},
     Artifact,
 };
+use cargo_metadata::TargetKind;
 
 // Path to cargo-auditable binary under test
 const EXE: &str = env!("CARGO_BIN_EXE_cargo-auditable");
@@ -104,7 +105,7 @@ where
                     .target
                     .kind
                     .iter()
-                    .any(|kind| kind.as_str() == "cdylib")
+                    .any(|kind| *kind == TargetKind::CDyLib)
                 {
                     // Detect files with .so (Linux), .dylib (Mac) and .dll (Windows) extensions
                     artifact