Skip to content

Commit e956171

Browse files
committed
rust: cosmetic changes in formatter module
1 parent ab1adc8 commit e956171

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rust/bear/src/semantic/transformation/formatter.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! file paths. In the current implementation, the `arguments` attribute is not
1111
//! transformed.
1212
13-
use super::*;
14-
use std::env;
15-
use std::path;
13+
use crate::{config, semantic};
14+
use std::{env, io, path};
15+
use thiserror::Error;
1616

1717
#[derive(Default, Debug)]
1818
pub enum PathFormatter {
@@ -62,6 +62,8 @@ impl TryFrom<&config::PathFormat> for PathFormatter {
6262

6363
/// Compute the absolute path from the root directory if the path is relative.
6464
fn absolute_to(root: &path::Path, path: &path::Path) -> Result<path::PathBuf, Error> {
65+
// TODO: instead of calling `canonicalize` on the path, we should use
66+
// `path::absolute` when the filesystem access is not allowed.
6567
if path.is_absolute() {
6668
Ok(path.canonicalize()?)
6769
} else {

0 commit comments

Comments
 (0)