Skip to content

Commit 82bdac8

Browse files
committed
fix: restore validation format_result field
1 parent 957f2d5 commit 82bdac8

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

crates/uroborosql-fmt/src/error.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ pub enum UroboroSQLFmtError {
2020
Runtime(String),
2121
#[error("Validation Error: {error_msg}\nformat_result: {format_result}")]
2222
Validation {
23-
// テストでしか使用しておらず、clippy で警告が出るため _ を付与
24-
_format_result: String,
23+
format_result: String,
2524
error_msg: String,
2625
},
2726
}

crates/uroborosql-fmt/src/validate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ fn compare_tokens(
6161
compare_token_text(src_token, dst_token, format_result, src)?
6262
} else {
6363
return Err(UroboroSQLFmtError::Validation {
64-
_format_result: format_result.to_owned(),
64+
format_result: format_result.to_owned(),
6565
error_msg: format!("different kind token: Errors have occurred near the following token\n{}", error_annotation(src_token, Some(dst_token), src)),
6666
});
6767
}
6868
}
6969
itertools::EitherOrBoth::Left(src_token) => {
7070
// src.len() > dst.len() の場合
7171
return Err(UroboroSQLFmtError::Validation {
72-
_format_result: format_result.to_owned(),
72+
format_result: format_result.to_owned(),
7373
error_msg: format!(
7474
"different kind token: Errors have occurred near the following token\n{}",
7575
error_annotation(src_token, None, src)
@@ -79,7 +79,7 @@ fn compare_tokens(
7979
itertools::EitherOrBoth::Right(_) => {
8080
// src.len() < dst.len() の場合
8181
return Err(UroboroSQLFmtError::Validation {
82-
_format_result: format_result.to_owned(),
82+
format_result: format_result.to_owned(),
8383
error_msg: format!("different kind token: For some reason the number of tokens in the format result has increased\nformat_result: \n{format_result}"),
8484
});
8585
}
@@ -109,7 +109,7 @@ fn compare_token_text(
109109
Ok(())
110110
} else {
111111
Err(UroboroSQLFmtError::Validation {
112-
_format_result: format_result.to_owned(),
112+
format_result: format_result.to_owned(),
113113
error_msg: format!(
114114
r#"hint must start with "/*+" or "--+".\n{}"#,
115115
error_annotation(src_token, Some(dst_token), src)

0 commit comments

Comments
 (0)