Skip to content

Commit 57184ec

Browse files
generate-copyright: import std::path::Path
1 parent 4256c62 commit 57184ec

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/tools/generate-copyright/src/cargo_metadata.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Gets metadata about a workspace from Cargo
22
3+
use std::path::Path;
4+
35
/// Describes how this module can fail
46
#[derive(Debug, thiserror::Error)]
57
pub enum Error {
@@ -32,11 +34,7 @@ pub struct Dependency {
3234
///
3335
/// Any dependency with a path beginning with `root_path` is ignored, as we
3436
/// assume `reuse` has covered it already.
35-
pub fn get(
36-
cargo: &std::path::Path,
37-
manifest_path: &std::path::Path,
38-
root_path: &std::path::Path,
39-
) -> Result<Vec<Dependency>, Error> {
37+
pub fn get(cargo: &Path, manifest_path: &Path, root_path: &Path) -> Result<Vec<Dependency>, Error> {
4038
if manifest_path.file_name() != Some(std::ffi::OsStr::new("Cargo.toml")) {
4139
panic!("cargo_manifest::get requires a path to a Cargo.toml file");
4240
}
@@ -66,7 +64,7 @@ pub fn get(
6664
let manifest_path = package
6765
.get("manifest_path")
6866
.and_then(|v| v.as_str())
69-
.map(std::path::Path::new)
67+
.map(Path::new)
7068
.ok_or_else(|| Error::MissingJsonElement("package.manifest_path"))?;
7169
if manifest_path.starts_with(&root_path) {
7270
// it's an in-tree dependency and reuse covers it

0 commit comments

Comments
 (0)