mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
chore: resolve v2 warnings in common_utils (#7358)
Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
This commit is contained in:
committed by
GitHub
parent
c6c57c1c52
commit
338a95372c
@ -134,7 +134,7 @@ impl GlobalId {
|
||||
) -> Result<Self, GlobalIdError> {
|
||||
let length_id = LengthId::from(input_string)?;
|
||||
let input_string = &length_id.0 .0;
|
||||
let (cell_id, remaining) = input_string
|
||||
let (cell_id, _remaining) = input_string
|
||||
.split_once("_")
|
||||
.ok_or(GlobalIdError::InvalidIdFormat)?;
|
||||
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
use error_stack::ResultExt;
|
||||
|
||||
use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
|
||||
use crate::errors;
|
||||
|
||||
crate::global_id_type!(
|
||||
GlobalCustomerId,
|
||||
@ -29,7 +27,7 @@ impl GlobalCustomerId {
|
||||
}
|
||||
|
||||
impl TryFrom<GlobalCustomerId> for crate::id_type::CustomerId {
|
||||
type Error = error_stack::Report<crate::errors::ValidationError>;
|
||||
type Error = error_stack::Report<errors::ValidationError>;
|
||||
|
||||
fn try_from(value: GlobalCustomerId) -> Result<Self, Self::Error> {
|
||||
Self::try_from(std::borrow::Cow::from(value.get_string_repr().to_owned()))
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use common_enums::enums;
|
||||
use error_stack::ResultExt;
|
||||
|
||||
use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
|
||||
use crate::errors;
|
||||
|
||||
crate::global_id_type!(
|
||||
GlobalPaymentId,
|
||||
@ -42,7 +42,6 @@ impl GlobalPaymentId {
|
||||
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalPaymentId {
|
||||
type Error = error_stack::Report<errors::ValidationError>;
|
||||
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
|
||||
use error_stack::ResultExt;
|
||||
let merchant_ref_id = super::GlobalId::from_string(value).change_context(
|
||||
errors::ValidationError::IncorrectValueProvided {
|
||||
field_name: "payment_id",
|
||||
@ -86,7 +85,6 @@ impl GlobalAttemptId {
|
||||
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalAttemptId {
|
||||
type Error = error_stack::Report<errors::ValidationError>;
|
||||
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
|
||||
use error_stack::ResultExt;
|
||||
let global_attempt_id = super::GlobalId::from_string(value).change_context(
|
||||
errors::ValidationError::IncorrectValueProvided {
|
||||
field_name: "payment_id",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use error_stack::ResultExt;
|
||||
|
||||
use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
|
||||
use crate::errors;
|
||||
|
||||
/// A global id that can be used to identify a refund
|
||||
#[derive(
|
||||
@ -36,7 +36,6 @@ impl GlobalRefundId {
|
||||
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalRefundId {
|
||||
type Error = error_stack::Report<errors::ValidationError>;
|
||||
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
|
||||
use error_stack::ResultExt;
|
||||
let merchant_ref_id = super::GlobalId::from_string(value).change_context(
|
||||
errors::ValidationError::IncorrectValueProvided {
|
||||
field_name: "refund_id",
|
||||
|
||||
Reference in New Issue
Block a user