Skip to content

Commit

Permalink
Address recent lint warnings (#1824)
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee authored Aug 21, 2024
1 parent badc0a5 commit 22d7fce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
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())
}

0 comments on commit 22d7fce

Please sign in to comment.