refactor: 移除未使用的代码和注释掉的辅助函数
This commit is contained in:
@@ -9,7 +9,7 @@ pub mod profile;
|
||||
|
||||
pub use profile::{
|
||||
GitProfile, TokenConfig, TokenType,
|
||||
UsageStats, ProfileComparison
|
||||
ProfileComparison
|
||||
};
|
||||
|
||||
/// Application configuration
|
||||
@@ -505,18 +505,18 @@ impl AppConfig {
|
||||
Ok(config_dir.join("quicommit").join("config.toml"))
|
||||
}
|
||||
|
||||
/// Get profile for a repository
|
||||
pub fn get_profile_for_repo(&self, repo_path: &str) -> Option<&GitProfile> {
|
||||
let profile_name = self.repo_profiles.get(repo_path)?;
|
||||
self.profiles.get(profile_name)
|
||||
}
|
||||
// /// Get profile for a repository
|
||||
// pub fn get_profile_for_repo(&self, repo_path: &str) -> Option<&GitProfile> {
|
||||
// let profile_name = self.repo_profiles.get(repo_path)?;
|
||||
// self.profiles.get(profile_name)
|
||||
// }
|
||||
|
||||
/// Set profile for a repository
|
||||
pub fn set_profile_for_repo(&mut self, repo_path: String, profile_name: String) -> Result<()> {
|
||||
if !self.profiles.contains_key(&profile_name) {
|
||||
anyhow::bail!("Profile '{}' does not exist", profile_name);
|
||||
}
|
||||
self.repo_profiles.insert(repo_path, profile_name);
|
||||
Ok(())
|
||||
}
|
||||
// /// Set profile for a repository
|
||||
// pub fn set_profile_for_repo(&mut self, repo_path: String, profile_name: String) -> Result<()> {
|
||||
// if !self.profiles.contains_key(&profile_name) {
|
||||
// anyhow::bail!("Profile '{}' does not exist", profile_name);
|
||||
// }
|
||||
// self.repo_profiles.insert(repo_path, profile_name);
|
||||
// Ok(())
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user