Skip to content
Merged
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
28 changes: 13 additions & 15 deletions cargo-pgrx/src/command/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,19 @@ pub(crate) fn find_control_file(
for f in std::fs::read_dir(parent).wrap_err_with(|| {
eyre!("cannot open current directory `{}` for reading", parent.display())
})? {
if f.is_ok() {
if let Ok(f) = f {
let f_path = f.path();
if f_path.extension() == Some("control".as_ref()) {
let file_stem = f_path.file_stem().ok_or_else(|| {
eyre!("could not get file stem of `{}`", f_path.display())
})?;
let file_stem = file_stem
.to_str()
.ok_or_else(|| {
eyre!("could not get file stem as String from `{}`", f_path.display())
})?
.to_string();
return Ok((f_path, file_stem));
}
if let Ok(f) = f {
let f_path = f.path();
if f_path.extension() == Some("control".as_ref()) {
let file_stem = f_path
.file_stem()
.ok_or_else(|| eyre!("could not get file stem of `{}`", f_path.display()))?;
let file_stem = file_stem
.to_str()
.ok_or_else(|| {
eyre!("could not get file stem as String from `{}`", f_path.display())
})?
.to_string();
return Ok((f_path, file_stem));
}
}
}
Expand Down
Loading