Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 4 additions & 2 deletions crates/turborepo-boundaries/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ fn check_import_as_tsconfig_path_alias(
return Ok((false, None));
}

let dir = file_path.parent().expect("file_path must have a parent");
let dir = file_path
.parent()
.ok_or_else(|| Error::NoParentDir(file_path.to_owned()))?;

match resolver.resolve(dir, import) {
Ok(resolution) => {
Expand Down Expand Up @@ -395,7 +397,7 @@ pub(crate) fn check_package_import(
});
}
let package_node = PackageNode::Workspace(PackageName::Other(package_name.to_string()));
let folder = file_path.parent().expect("file_path should have a parent");
let folder = file_path.parent()?;
let is_valid_dependency = dependency_locations.is_dependency(&package_node);

if !is_valid_dependency
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-boundaries/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(clippy::sliced_string_as_bytes)]
#![allow(clippy::expect_used, clippy::unwrap_used)]
#![allow(clippy::unwrap_used)]
// miette's derive macro causes false positives for these lints
#![allow(unused_assignments)]

Expand Down
Loading