]> git.lizzy.rs Git - rust.git/blobdiff - clippy_dev/src/serve.rs
Auto merge of #7782 - dswij:shadow-unrelated-block, r=flip1995
[rust.git] / clippy_dev / src / serve.rs
index a46c0e4d3f0a1525eb39ee56bee441eec6e710fd..b36e2a28ee45450a589c1c93035c0f77b2d1edb7 100644 (file)
@@ -4,6 +4,9 @@
 use std::thread;
 use std::time::{Duration, SystemTime};
 
+/// # Panics
+///
+/// Panics if the python commands could not be spawned
 pub fn run(port: u16, lint: Option<&str>) -> ! {
     let mut url = Some(match lint {
         None => format!("http://localhost:{}", port),
@@ -12,8 +15,8 @@ pub fn run(port: u16, lint: Option<&str>) -> ! {
 
     loop {
         if mtime("util/gh-pages/lints.json") < mtime("clippy_lints/src") {
-            Command::new("python3")
-                .arg("util/export.py")
+            Command::new("cargo")
+                .arg("collect-metadata")
                 .spawn()
                 .unwrap()
                 .wait()
@@ -31,7 +34,7 @@ pub fn run(port: u16, lint: Option<&str>) -> ! {
                 // Give some time for python to start
                 thread::sleep(Duration::from_millis(500));
                 // Launch browser after first export.py has completed and http.server is up
-                let _ = opener::open(url);
+                let _result = opener::open(url);
             });
         }
         thread::sleep(Duration::from_millis(1000));