Sfoglia il codice sorgente

refactor: turn unused var into value

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 2 anni fa
parent
commit
95534eb3ea
1 ha cambiato i file con 1 aggiunte e 2 eliminazioni
  1. 1 2
      src/fs/feature/git.rs

+ 1 - 2
src/fs/feature/git.rs

@@ -179,8 +179,7 @@ impl GitRepo {
     /// path is the start of a rootwards search for the repository.
     fn discover(path: PathBuf, flags: git2::RepositoryOpenFlags) -> Result<Self, PathBuf> {
         info!("Opening Git repository for {:?} ({:?})", path, flags);
-        let unused: [&OsStr; 0] = [];
-        let repo = match git2::Repository::open_ext(&path, flags, &unused) {
+        let repo = match git2::Repository::open_ext(&path, flags, [] as [&OsStr; 0]) {
             Ok(r) => r,
             Err(e) => {
                 error!("Error opening Git repository for {:?}: {:?}", path, e);