Skip to content

Commit 253fd33

Browse files
authored
Merge pull request #297 from epage/path
fix(snap)!: Move `path` to `dir`
2 parents dff9cba + e764cde commit 253fd33

File tree

13 files changed

+386
-372
lines changed

13 files changed

+386
-372
lines changed

crates/snapbox/src/assert/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl Assert {
220220
}
221221

222222
let checks: Vec<_> =
223-
crate::path::PathDiff::subset_eq_iter_inner(expected_root, actual_root).collect();
223+
crate::dir::PathDiff::subset_eq_iter_inner(expected_root, actual_root).collect();
224224
self.verify(checks);
225225
}
226226

@@ -248,7 +248,7 @@ impl Assert {
248248
Action::Ignore | Action::Verify | Action::Overwrite => {}
249249
}
250250

251-
let checks: Vec<_> = crate::path::PathDiff::subset_matches_iter_inner(
251+
let checks: Vec<_> = crate::dir::PathDiff::subset_matches_iter_inner(
252252
expected_root,
253253
actual_root,
254254
&self.substitutions,
@@ -261,7 +261,7 @@ impl Assert {
261261
#[track_caller]
262262
fn verify(
263263
&self,
264-
mut checks: Vec<Result<(std::path::PathBuf, std::path::PathBuf), crate::path::PathDiff>>,
264+
mut checks: Vec<Result<(std::path::PathBuf, std::path::PathBuf), crate::dir::PathDiff>>,
265265
) {
266266
if checks.iter().all(Result::is_ok) {
267267
for check in checks {

crates/snapbox/src/data/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ macro_rules! file {
174174
$crate::Data::read_from(&path, Some($crate::data::DataFormat:: $type))
175175
}};
176176
[$path:literal] => {{
177-
let mut path = $crate::current_dir!();
177+
let mut path = $crate::utils::current_dir!();
178178
path.push($path);
179179
$crate::Data::read_from(&path, None)
180180
}};
181181
[$path:literal : $type:ident] => {{
182-
let mut path = $crate::current_dir!();
182+
let mut path = $crate::utils::current_dir!();
183183
path.push($path);
184184
$crate::Data::read_from(&path, Some($crate::data::DataFormat:: $type))
185185
}};
@@ -201,7 +201,7 @@ macro_rules! str {
201201
[$data:literal] => { $crate::str![[$data]] };
202202
[[$data:literal]] => {{
203203
let position = $crate::data::Position {
204-
file: $crate::path::current_rs!(),
204+
file: $crate::utils::current_rs!(),
205205
line: line!(),
206206
column: column!(),
207207
};

crates/snapbox/src/data/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl From<Inline> for DataSource {
6363
impl std::fmt::Display for DataSource {
6464
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6565
match &self.inner {
66-
DataSourceInner::Path(value) => crate::path::display_relpath(value).fmt(f),
66+
DataSourceInner::Path(value) => crate::dir::display_relpath(value).fmt(f),
6767
DataSourceInner::Inline(value) => value.fmt(f),
6868
}
6969
}

0 commit comments

Comments
 (0)