You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnErr(cargo_err(&format_args!("Dependency `{}` is hosted on another registry. Cross-registry dependencies are not permitted on crates.io.",&*dep.name)));
302
+
}
303
+
}
304
+
305
+
// Match only identical names to ensure the index always references the original crate name
306
+
let krate:Crate = Crate::by_exact_name(&dep.name)
307
+
.first(&*conn)
308
+
.map_err(|_| cargo_err(&format_args!("no known crate named `{}`",&*dep.name)))?;
309
+
if semver::VersionReq::parse(&dep.version_req.0) == semver::VersionReq::parse("*"){
310
+
returnErr(cargo_err(WILDCARD_ERROR_MESSAGE));
311
+
}
312
+
313
+
// If this dependency has an explicit name in `Cargo.toml` that
314
+
// means that the `name` we have listed is actually the package name
315
+
// that we're depending on. The `name` listed in the index is the
316
+
// Cargo.toml-written-name which is what cargo uses for
@@ -62,73 +52,3 @@ impl FromSql<Integer, Pg> for DependencyKind {
62
52
}
63
53
}
64
54
}
65
-
66
-
pubfnadd_dependencies(
67
-
conn:&PgConnection,
68
-
deps:&[EncodableCrateDependency],
69
-
target_version_id:i32,
70
-
) -> AppResult<Vec<git::Dependency>>{
71
-
useself::dependencies::dsl::*;
72
-
use diesel::insert_into;
73
-
74
-
let git_and_new_dependencies = deps
75
-
.iter()
76
-
.map(|dep| {
77
-
ifletSome(registry) = &dep.registry{
78
-
if !registry.is_empty(){
79
-
returnErr(cargo_err(&format_args!("Dependency `{}` is hosted on another registry. Cross-registry dependencies are not permitted on crates.io.",&*dep.name)));
80
-
}
81
-
}
82
-
83
-
// Match only identical names to ensure the index always references the original crate name
84
-
let krate:Crate = Crate::by_exact_name(&dep.name)
85
-
.first(&*conn)
86
-
.map_err(|_| cargo_err(&format_args!("no known crate named `{}`",&*dep.name)))?;
87
-
if semver::VersionReq::parse(&dep.version_req.0) == semver::VersionReq::parse("*"){
88
-
returnErr(cargo_err(WILDCARD_ERROR_MESSAGE));
89
-
}
90
-
91
-
// If this dependency has an explicit name in `Cargo.toml` that
92
-
// means that the `name` we have listed is actually the package name
93
-
// that we're depending on. The `name` listed in the index is the
94
-
// Cargo.toml-written-name which is what cargo uses for
0 commit comments