Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address recent lint warnings #1824

Merged
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
2 changes: 2 additions & 0 deletions pgrx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub mod fn_call;
pub mod guc;
pub mod heap_tuple;
#[cfg(feature = "cshim")]
#[allow(deprecated)]
pub mod hooks;
pub mod htup;
pub mod inoutfuncs;
Expand Down Expand Up @@ -94,6 +95,7 @@ pub use enum_helper::*;
pub use fcinfo::*;
pub use guc::*;
#[cfg(feature = "cshim")]
#[allow(deprecated)]
pub use hooks::*;
pub use htup::*;
pub use inoutfuncs::*;
Expand Down
21 changes: 3 additions & 18 deletions tools/version-updater/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn update_files(args: &UpdateFilesArgs) {

// Contains a set of package names (e.g. "pgrx", "pgrx-pg-sys") that will be used
// to search for updatable dependencies later on
let mut updatable_package_names = workspace
let updatable_package_names = workspace
.members
.iter()
.map(|s| {
Expand Down Expand Up @@ -195,7 +195,7 @@ fn update_files(args: &UpdateFilesArgs) {
format!("Could not get full path for file {}", entry.path().display()).as_str(),
);

let mut output = format!(
let output = format!(
"{} Cargo.toml file at {}",
"Discovered".bold().green(),
filepath.display().cyan()
Expand All @@ -214,7 +214,7 @@ fn update_files(args: &UpdateFilesArgs) {
let filepath =
fullpath(file).expect(format!("Could not get full path for file {file}").as_str());

let mut output = format!(
let output = format!(
"{} Cargo.toml file at {} for processing",
" Including".bold().green(),
filepath.display().cyan()
Expand Down Expand Up @@ -452,18 +452,3 @@ fn parse_new_version(current_version_specifier: &str, new_version: &str) -> Stri

result
}

// Given a filepath pointing to a Cargo.toml file, extract out the [package] name
// if it has one
fn extract_package_name<P: AsRef<Path>>(filepath: P) -> Option<String> {
let filepath = filepath.as_ref();

let data = fs::read_to_string(filepath)
.expect(format!("Unable to open file at {}", filepath.display()).as_str());

let doc = data.parse::<DocumentMut>().expect(
format!("File at location {} is an invalid Cargo.toml file", filepath.display()).as_str(),
);

doc.get("package")?.as_table()?.get("name")?.as_str().map(|s| s.to_string())
}
Loading