ctrl k
  • chore: Removed duplicate code and simplify

  • Loading...
  • Uzair Aftab committed 2 years ago
    622448cc
    1 parent f48acac2
  • src/git_operations.rs
    ■ ■ ■ ■ ■
    skipped 3 lines
    4 4  use serde::Deserialize;
    5 5  use std::{collections::HashSet, process::Command};
    6 6   
    7  -use crate::file_system;
     7 +use crate::{astrocommunity::PluginInfo, file_system};
    8 8   
    9 9  pub static GITHUB_API_TREE_RECURSIVE: Lazy<String> = Lazy::new(|| {
    10 10   let file_system = file_system::FileSystem::new();
    skipped 15 lines
    26 26   path: String,
    27 27  }
    28 28   
    29  -#[derive(Debug, Clone, Hash, Eq, PartialEq, PartialOrd, Ord)]
    30  -pub(crate) struct PluginInfo {
    31  - pub group: String,
    32  - pub name: String,
    33  - pub fzf_string: String,
    34  - plugin_path: String,
    35  -}
    36  - 
    37 29  pub struct GitOperations;
    38 30   
    39 31  impl GitOperations {
    skipped 31 lines
    71 63   }
    72 64   }
    73 65   }
    74  - 
    75 66   Ok(plugins.into_iter().collect())
    76 67   }
    77 68   
    skipped 3 lines
    81 72   Some(PluginInfo {
    82 73   group: p[0].to_string(),
    83 74   name: p[1].to_string(),
    84  - fzf_string: format!("{} [{}]", p[1], p[0]),
    85  - plugin_path: format!("{}/{}/README.md", REPO_PATH_PREFIX, path),
    86 75   })
    87 76   } else {
    88 77   None
    skipped 4 lines
Please wait...
Page is in error, reload to recover