Skip to content

Commit

Permalink
refactor: remove redundant references (&) (#1941)
Browse files Browse the repository at this point in the history
Fixes #1940
  • Loading branch information
hamirmahal authored Nov 15, 2024
1 parent 6c9a85f commit 68c4970
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/cross/pgrx_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn make_target_info(cmd: &PgrxTarget, tmp: &Path) -> Result<()> {
.arg("--features")
.arg(format!("pgrx-pg-sys/pg{major_version}"))
.env("PGRX_PG_CONFIG_PATH", &pg_config_path)
.env("PGRX_PG_SYS_EXTRA_OUTPUT_PATH", &tmp.join(&filename)))?;
.env("PGRX_PG_SYS_EXTRA_OUTPUT_PATH", tmp.join(&filename)))?;

run(Command::new("rustfmt").current_dir(tmp).arg(&filename))?;
run(Command::new("tar").current_dir(tmp).arg("czf").arg("out.tgz").arg(&filename))?;
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fn untar(bytes: &[u8], pgrxdir: &Path, pg_config: &PgConfig, init: &Init) -> eyr
let _token = init.jobserver.get().unwrap().acquire().unwrap();

let mut unpackdir = pgrxdir.to_path_buf();
unpackdir.push(&format!("{}_unpack", pg_config.version()?));
unpackdir.push(format!("{}_unpack", pg_config.version()?));
if unpackdir.exists() {
// delete everything at this path if it already exists
println!("{} {}", " Removing".bold().green(), unpackdir.display());
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub(crate) fn install_extension(
let mut output_tracking = Vec::new();
let base_directory = base_directory.unwrap_or_else(|| PathBuf::from("/"));
tracing::Span::current()
.record("base_directory", &tracing::field::display(&base_directory.display()));
.record("base_directory", tracing::field::display(&base_directory.display()));

let manifest = Manifest::from_path(&package_manifest_path)?;
let (control_file, extname) = find_control_file(&package_manifest_path)?;
Expand Down
6 changes: 3 additions & 3 deletions cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ fn first_build(

if !features_arg.trim().is_empty() {
command.arg("--features");
command.arg(&features_arg);
command.arg(features_arg);
}

if features.no_default_features {
Expand Down Expand Up @@ -387,7 +387,7 @@ fn compute_codegen(
dot: Option<String>,
) -> eyre::Result<String> {
use proc_macro2::{Ident, Span, TokenStream};
let lib_name_ident = Ident::new(&lib_name, Span::call_site());
let lib_name_ident = Ident::new(lib_name, Span::call_site());

let inputs = {
let control_file_path = control_file_path
Expand Down Expand Up @@ -501,7 +501,7 @@ fn second_build(

if !features_arg.trim().is_empty() {
command.arg("--features");
command.arg(&features_arg);
command.arg(features_arg);
}

if features.no_default_features {
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn test_extension(
pgdata: Option<PathBuf>,
) -> eyre::Result<()> {
if let Some(ref testname) = testname {
tracing::Span::current().record("testname", &tracing::field::display(&testname.as_ref()));
tracing::Span::current().record("testname", tracing::field::display(&testname.as_ref()));
}
let target_dir = get_target_dir()?;

Expand Down
4 changes: 2 additions & 2 deletions pgrx-bindgen/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ fn generate_bindings(
};
for dest_dir in dest_dirs {
let mut bindings_file = dest_dir.clone();
bindings_file.push(&format!("pg{major_version}.rs"));
bindings_file.push(format!("pg{major_version}.rs"));
write_rs_file(
rewritten_items.clone(),
&bindings_file,
Expand All @@ -334,7 +334,7 @@ fn generate_bindings(
})?;

let mut oids_file = dest_dir.clone();
oids_file.push(&format!("pg{major_version}_oids.rs"));
oids_file.push(format!("pg{major_version}_oids.rs"));
write_rs_file(oids.clone(), &oids_file, quote! {}, is_for_release).wrap_err_with(|| {
format!(
"Unable to write oids file for pg{} to `{}`",
Expand Down
2 changes: 1 addition & 1 deletion pgrx-pg-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ fn does_db_exist(pg_config: &PgConfig, dbname: &str) -> eyre::Result<bool> {
.arg(pg_config.port()?.to_string())
.arg("template1")
.arg("-c")
.arg(&format!(
.arg(format!(
"select count(*) from pg_database where datname = '{}';",
dbname.replace('\'', "''")
))
Expand Down

0 comments on commit 68c4970

Please sign in to comment.