fix: code lint

This commit is contained in:
huzibaca 2024-09-24 20:11:33 +08:00
parent 4b20b65a22
commit 3bcd8b8b2c
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302
3 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ pub fn parse_check_output(log: String) -> String {
#[test] #[test]
fn test_parse_check_output() { fn test_parse_check_output() {
let str1 = r#"xxxx\n time="2022-11-18T20:42:58+08:00" level=error msg="proxy 0: 'alpn' expected type 'string', got unconvertible type '[]interface {}'""#; let str1 = r#"xxxx\n time="2022-11-18T20:42:58+08:00" level=error msg="proxy 0: 'alpn' expected type 'string', got unconvertible type '[]interface {}'""#;
let str2 = r#"20:43:49 ERR [Config] configuration file test failed error=proxy 0: unsupport proxy type: hysteria path=xxx"#; //let str2 = r#"20:43:49 ERR [Config] configuration file test failed error=proxy 0: unsupport proxy type: hysteria path=xxx"#;
let str3 = r#" let str3 = r#"
"time="2022-11-18T21:38:01+08:00" level=info msg="Start initial configuration in progress" "time="2022-11-18T21:38:01+08:00" level=info msg="Start initial configuration in progress"
time="2022-11-18T21:38:01+08:00" level=error msg="proxy 0: 'alpn' expected type 'string', got unconvertible type '[]interface {}'" time="2022-11-18T21:38:01+08:00" level=error msg="proxy 0: 'alpn' expected type 'string', got unconvertible type '[]interface {}'"

View File

@ -54,7 +54,7 @@ fn test_merge() -> anyhow::Result<()> {
let merge = serde_yaml::from_str::<Mapping>(merge)?; let merge = serde_yaml::from_str::<Mapping>(merge)?;
let config = serde_yaml::from_str::<Mapping>(config)?; let config = serde_yaml::from_str::<Mapping>(config)?;
let result = serde_yaml::to_string(&use_merge(merge, config))?; let _ = serde_yaml::to_string(&use_merge(merge, config))?;
Ok(()) Ok(())
} }

View File

@ -103,7 +103,7 @@ fn test_script() {
let config = serde_yaml::from_str(config).unwrap(); let config = serde_yaml::from_str(config).unwrap();
let (config, results) = use_script(script.into(), config, "".to_string()).unwrap(); let (config, results) = use_script(script.into(), config, "".to_string()).unwrap();
let config_str = serde_yaml::to_string(&config).unwrap(); let _ = serde_yaml::to_string(&config).unwrap();
dbg!(results); dbg!(results);
} }