Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cppcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pub struct Error {
#[serde(rename = "@cwe")]
pub cwe: Option<String>,
pub location: Option<Vec<Location>>,
pub symbol: Option<String>,
#[serde(default)]
pub symbol: Vec<String>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ fn _main() -> Result<(), Box<dyn Error>> {
format!(
"{} {}",
error.id,
error.symbol.unwrap_or_else(|| "".to_string())
error
.symbol
.get(0)
.map(String::as_str)
.unwrap_or_else(|| "")
)
} else {
error.msg
Expand Down