mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	fix: add fallback to reverselookup error (#3025)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -1,68 +1,4 @@ | ||||
| #[macro_export] | ||||
| macro_rules! newtype_impl { | ||||
|     ($is_pub:vis, $name:ident, $ty_path:path) => { | ||||
|         impl std::ops::Deref for $name { | ||||
|             type Target = $ty_path; | ||||
|  | ||||
|             fn deref(&self) -> &Self::Target { | ||||
|                 &self.0 | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         impl std::ops::DerefMut for $name { | ||||
|             fn deref_mut(&mut self) -> &mut Self::Target { | ||||
|                 &mut self.0 | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         impl From<$ty_path> for $name { | ||||
|             fn from(ty: $ty_path) -> Self { | ||||
|                 Self(ty) | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         impl $name { | ||||
|             pub fn into_inner(self) -> $ty_path { | ||||
|                 self.0 | ||||
|             } | ||||
|         } | ||||
|     }; | ||||
| } | ||||
|  | ||||
| #[macro_export] | ||||
| macro_rules! newtype { | ||||
|     ($is_pub:vis $name:ident = $ty_path:path) => { | ||||
|         $is_pub struct $name(pub $ty_path); | ||||
|  | ||||
|         $crate::newtype_impl!($is_pub, $name, $ty_path); | ||||
|     }; | ||||
|  | ||||
|     ($is_pub:vis $name:ident = $ty_path:path, derives = ($($trt:path),*)) => { | ||||
|         #[derive($($trt),*)] | ||||
|         $is_pub struct $name(pub $ty_path); | ||||
|  | ||||
|         $crate::newtype_impl!($is_pub, $name, $ty_path); | ||||
|     }; | ||||
| } | ||||
|  | ||||
| #[macro_export] | ||||
| macro_rules! async_spawn { | ||||
|     ($t:block) => { | ||||
|         tokio::spawn(async move { $t }); | ||||
|     }; | ||||
| } | ||||
|  | ||||
| #[macro_export] | ||||
| macro_rules! collect_missing_value_keys { | ||||
|     [$(($key:literal, $option:expr)),+] => { | ||||
|         { | ||||
|             let mut keys: Vec<&'static str> = Vec::new(); | ||||
|             $( | ||||
|                 if $option.is_none() { | ||||
|                     keys.push($key); | ||||
|                 } | ||||
|             )* | ||||
|             keys | ||||
|         } | ||||
|     }; | ||||
| } | ||||
| pub use common_utils::{ | ||||
|     async_spawn, collect_missing_value_keys, fallback_reverse_lookup_not_found, newtype, | ||||
|     newtype_impl, | ||||
| }; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Kartikeya Hegde
					Kartikeya Hegde