File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ use std::fs;
4
4
use std:: path:: Path ;
5
5
6
6
/// List of allowed sources for packages.
7
- const ALLOWED_SOURCES : & [ & str ] = & [ "\" registry+https://github.com/rust-lang/crates.io-index\" " ] ;
7
+ const ALLOWED_SOURCES : & [ & str ] = & [
8
+ "\" registry+https://github.com/rust-lang/crates.io-index\" " ,
9
+ "\" git+https://github.com/lzutao/rust-libc" ,
10
+ ] ;
8
11
9
12
/// Checks for external package sources. `root` is the path to the directory that contains the
10
13
/// workspace `Cargo.toml`.
@@ -26,7 +29,14 @@ pub fn check(root: &Path, bad: &mut bool) {
26
29
let source = line. splitn ( 2 , '=' ) . nth ( 1 ) . unwrap ( ) . trim ( ) ;
27
30
28
31
// Ensure source is allowed.
29
- if !ALLOWED_SOURCES . contains ( & & * source) {
32
+ let mut matched = false ;
33
+ for allowed in ALLOWED_SOURCES {
34
+ if source. starts_with ( allowed) {
35
+ matched = true ;
36
+ break ;
37
+ }
38
+ }
39
+ if !matched {
30
40
println ! ( "invalid source: {}" , source) ;
31
41
* bad = true ;
32
42
}
You can’t perform that action at this time.
0 commit comments