Skip to content

Commit

Permalink
Rename Masklen to SetMasklen
Browse files Browse the repository at this point in the history
  • Loading branch information
dadepo committed Apr 20, 2024
1 parent 6b18d28 commit ce23cf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/postgres/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::postgres::math_udfs::{
Acosd, Asind, Atand, Ceiling, Cosd, Cotd, Div, Erf, Erfc, RandomNormal, Sind, Tand,
};
use crate::postgres::network_udfs::{
broadcast, family, host, hostmask, inet_merge, inet_same_family, masklen, Masklen, Netmask,
broadcast, family, host, hostmask, inet_merge, inet_same_family, masklen, SetMasklen, Netmask,
Network,
};

Expand Down Expand Up @@ -52,7 +52,7 @@ fn register_network_udfs(ctx: &SessionContext) -> Result<()> {
register_masklen(ctx);
ctx.register_udf(ScalarUDF::from(Netmask::new()));
ctx.register_udf(ScalarUDF::from(Network::new()));
ctx.register_udf(ScalarUDF::from(Masklen::new()));
ctx.register_udf(ScalarUDF::from(SetMasklen::new()));
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions src/postgres/network_udfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,19 @@ impl ScalarUDFImpl for Network {
/// If the input is a CIDR, Address bits to the right of the new netmask are set to zero.
/// Returns NULL if any of the columns contain NULL values.
#[derive(Debug)]
pub struct Masklen {
pub struct SetMasklen {
signature: Signature,
}

impl Masklen {
impl SetMasklen {
pub fn new() -> Self {
Self {
signature: Signature::exact(vec![Utf8, Int64], Volatility::Immutable),
}
}
}

impl ScalarUDFImpl for Masklen {
impl ScalarUDFImpl for SetMasklen {
fn as_any(&self) -> &dyn std::any::Any {
self
}
Expand Down

0 comments on commit ce23cf2

Please sign in to comment.