Skip to content

Commit

Permalink
Clean up even more redundant code (#1623)
Browse files Browse the repository at this point in the history
I don't know if I just missed these the first time or the algorithm for
finding unused stuff got stronger in the past few nights, but even more
repetition whines if you use nightly.
  • Loading branch information
workingjubilee authored Mar 26, 2024
1 parent 703ccbe commit fe9ab69
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 14 deletions.
9 changes: 2 additions & 7 deletions pgrx-sql-entity-graph/src/pgrx_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ impl Parse for PgrxArg {
#[track_caller]
fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
let path = input.parse::<syn::Path>()?;
if input.peek(Token![=]) {
Ok(Self::NameValue(NameValueArg {
path,
eq_token: input.parse()?,
value: input.parse()?,
}))
if let Ok(_) = input.parse::<Token![=]>() {
Ok(Self::NameValue(NameValueArg { path, value: input.parse()? }))
} else {
Err(input.error("unsupported argument to #[pgrx] in this context"))
}
Expand All @@ -81,7 +77,6 @@ impl Parse for PgrxArg {
#[derive(Debug)]
pub struct NameValueArg {
pub path: syn::Path,
pub eq_token: syn::token::Eq,
pub value: ArgValue,
}

Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/aggregate_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use pgrx::prelude::*;
use pgrx::{Aggregate, Internal, ParallelOption};
use pgrx::Internal;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;

Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/anyarray_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use pgrx::prelude::*;
use pgrx::{direct_function_call, AnyArray, IntoDatum, Json};
use pgrx::{direct_function_call, AnyArray, Json};

#[pg_extern]
fn anyarray_arg(array: AnyArray) -> Json {
Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/array_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use pgrx::array::RawArray;
use pgrx::prelude::*;
use pgrx::Json;
use pgrx::PostgresEnum;
use pgrx::{Array, Json};
use serde::Serialize;
use serde_json::*;

Expand Down
1 change: 0 additions & 1 deletion pgrx-tests/src/tests/bgworker_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use pgrx::prelude::*;
use pgrx::{FromDatum, IntoDatum, PgOid};

#[pg_guard]
#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/fcinfo_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use pgrx::prelude::*;
use pgrx::{InOutFuncs, StringInfo};
use pgrx::StringInfo;
use serde::{Deserialize, Serialize};

#[pg_extern]
Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/postgres_type_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use core::ffi::CStr;
use pgrx::prelude::*;
use pgrx::{InOutFuncs, PgVarlena, PgVarlenaInOutFuncs, StringInfo};
use pgrx::StringInfo;
use serde::{Deserialize, Serialize};
use std::str::FromStr;

Expand Down
1 change: 0 additions & 1 deletion pgrx-tests/src/tests/struct_type_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use pgrx::pgrx_sql_entity_graph::metadata::{
};
use pgrx::prelude::*;
use pgrx::stringinfo::StringInfo;
use pgrx::AllocatedByRust;

use crate::get_named_capture;

Expand Down

0 comments on commit fe9ab69

Please sign in to comment.