File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ use std::fs;
44use std:: path:: Path ;
55
66/// 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+ ] ;
811
912/// Checks for external package sources. `root` is the path to the directory that contains the
1013/// workspace `Cargo.toml`.
@@ -26,7 +29,14 @@ pub fn check(root: &Path, bad: &mut bool) {
2629 let source = line. splitn ( 2 , '=' ) . nth ( 1 ) . unwrap ( ) . trim ( ) ;
2730
2831 // 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 {
3040 println ! ( "invalid source: {}" , source) ;
3141 * bad = true ;
3242 }
You can’t perform that action at this time.
0 commit comments