|
1 | 1 | use std::sync::Arc; |
2 | 2 | use std::collections::HashMap; |
3 | 3 | use async_trait::async_trait; |
4 | | -use tracing::{error, info}; |
5 | 4 | use tokio::sync::Mutex as AMutex; |
6 | 5 | use tokio::sync::RwLock as ARwLock; |
7 | 6 | use tokio::process::Command; |
@@ -34,24 +33,9 @@ pub struct ToolGitlab { |
34 | 33 | impl IntegrationTrait for ToolGitlab { |
35 | 34 | fn as_any(&self) -> &dyn std::any::Any { self } |
36 | 35 |
|
37 | | - async fn integr_settings_apply(&mut self, _gcx: Arc<ARwLock<GlobalContext>>, config_path: String, value: &serde_json::Value) -> Result<(), String> { |
38 | | - match serde_json::from_value::<SettingsGitLab>(value.clone()) { |
39 | | - Ok(settings_gitlab) => { |
40 | | - info!("GitLab settings applied: {:?}", settings_gitlab); |
41 | | - self.settings_gitlab = settings_gitlab; |
42 | | - }, |
43 | | - Err(e) => { |
44 | | - error!("Failed to apply settings: {}\n{:?}", e, value); |
45 | | - return Err(e.to_string()) |
46 | | - } |
47 | | - }; |
48 | | - match serde_json::from_value::<IntegrationCommon>(value.clone()) { |
49 | | - Ok(x) => self.common = x, |
50 | | - Err(e) => { |
51 | | - error!("Failed to apply common settings: {}\n{:?}", e, value); |
52 | | - return Err(e.to_string()); |
53 | | - } |
54 | | - }; |
| 36 | + async fn integr_settings_apply(&mut self, _gcx: Arc<ARwLock<GlobalContext>>, config_path: String, value: &serde_json::Value) -> Result<(), serde_json::Error> { |
| 37 | + self.settings_gitlab = serde_json::from_value(value.clone())?; |
| 38 | + self.common = serde_json::from_value(value.clone())?; |
55 | 39 | self.config_path = config_path; |
56 | 40 | Ok(()) |
57 | 41 | } |
@@ -184,7 +168,7 @@ fn parse_command_args(args: &HashMap<String, Value>) -> Result<Vec<String>, Stri |
184 | 168 | return Err("Parsed command is empty".to_string()); |
185 | 169 | } |
186 | 170 | for (i, arg) in parsed_args.iter().enumerate() { |
187 | | - info!("argument[{}]: {}", i, arg); |
| 171 | + tracing::info!("argument[{}]: {}", i, arg); |
188 | 172 | } |
189 | 173 | if parsed_args[0] == "glab" { |
190 | 174 | parsed_args.remove(0); |
|
0 commit comments