Skip to content

Commit a70030d

Browse files
committed
last review change
1 parent 7c71a75 commit a70030d

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

cpp-linter/src/cli/structs.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl From<&Cli> for FeedbackInput {
261261
tidy_review: args.feedback_options.tidy_review,
262262
format_review: args.feedback_options.format_review,
263263
passive_reviews: args.feedback_options.passive_reviews,
264-
repo_root: PathBuf::from(&args.source_options.repo_root),
264+
repo_root: args.source_options.repo_root.clone(),
265265
}
266266
}
267267
}
@@ -288,7 +288,6 @@ mod test {
288288
#![allow(clippy::unwrap_used)]
289289

290290
use clap::{Parser, ValueEnum};
291-
use std::path::PathBuf;
292291

293292
use super::{ClangParams, Cli, LinesChangedOnly, ThreadComments};
294293

@@ -331,18 +330,16 @@ mod test {
331330
}
332331

333332
#[test]
334-
fn relative_db_path() {
333+
fn absolute_db_path() {
334+
let tmp_dir = tempfile::tempdir().unwrap();
335335
let cli = Cli::parse_from([
336336
"cpp-linter",
337337
"--database",
338-
"path/to/compile_commands.json",
338+
"path/to/build",
339339
"--repo-root",
340-
"relative",
340+
tmp_dir.path().to_str().unwrap(),
341341
]);
342342
let clang_params = ClangParams::from(&cli);
343-
assert_eq!(
344-
clang_params.database,
345-
Some(PathBuf::from("relative/path/to/compile_commands.json"))
346-
);
343+
assert_eq!(clang_params.database, Some(tmp_dir.path().to_path_buf()));
347344
}
348345
}

0 commit comments

Comments
 (0)