Add Rust detector
Detect Rust projects using the presence of a Cargo.toml file
@@ -28,6 +28,7 @@ var DefaultDetectors = Detectors{
DetectDotNet,
DetectLiteralDotNet,
DetectGolang,
+ DetectRust,
}
// DetectRuby detects Ruby source
@@ -80,6 +81,11 @@ func DetectGolang(dir string) *Info {
return detect("golang", dir, "main.go", "Godeps")
}
+// DetectRust detects Rust source
+func DetectRust(dir string) *Info {
+ return detect("rust", dir, "Cargo.toml")
+}
+
// detect returns an Info object with the given platform if the source at dir contains any of the argument files
func detect(platform string, dir string, globs ...string) *Info {
for _, g := range globs {
