mirror of
				https://github.com/haraldh/chainerror.git
				synced 2025-10-31 14:41:37 +01:00 
			
		
		
		
	simplify macros
This commit is contained in:
		
							parent
							
								
									2f8c68b36d
								
							
						
					
					
						commit
						8bd4ffca56
					
				
					 1 changed files with 0 additions and 24 deletions
				
			
		
							
								
								
									
										24
									
								
								src/lib.rs
									
										
									
									
									
								
							
							
						
						
									
										24
									
								
								src/lib.rs
									
										
									
									
									
								
							|  | @ -684,15 +684,9 @@ macro_rules! cherr { | ||||||
|     ( None, $fmt:expr, $($arg:tt)+ ) => ({ |     ( None, $fmt:expr, $($arg:tt)+ ) => ({ | ||||||
|         cherr!(None, format!($fmt, $($arg)+ )) |         cherr!(None, format!($fmt, $($arg)+ )) | ||||||
|     }); |     }); | ||||||
|     ( $e:ident, $k:expr ) => ({ |  | ||||||
|         ChainError::<_>::new($k, Some(Box::from($e)), Some((line!(), file!()))) |  | ||||||
|     }); |  | ||||||
|     ( $e:path, $k:expr ) => ({ |     ( $e:path, $k:expr ) => ({ | ||||||
|         ChainError::<_>::new($k, Some(Box::from($e)), Some((line!(), file!()))) |         ChainError::<_>::new($k, Some(Box::from($e)), Some((line!(), file!()))) | ||||||
|     }); |     }); | ||||||
|     ( $e:ident, $fmt:expr, $($arg:tt)+ ) => ({ |  | ||||||
|         cherr!($e, format!($fmt, $($arg)+ )) |  | ||||||
|     }); |  | ||||||
|     ( $e:path, $fmt:expr, $($arg:tt)+ ) => ({ |     ( $e:path, $fmt:expr, $($arg:tt)+ ) => ({ | ||||||
|         cherr!($e, format!($fmt, $($arg)+ )) |         cherr!($e, format!($fmt, $($arg)+ )) | ||||||
|     }); |     }); | ||||||
|  | @ -787,21 +781,12 @@ macro_rules! cherr { | ||||||
| /// ~~~
 | /// ~~~
 | ||||||
| #[macro_export] | #[macro_export] | ||||||
| macro_rules! mstrerr { | macro_rules! mstrerr { | ||||||
|     ( $t:ident, $msg:expr ) => ({ |  | ||||||
|         |e| cherr!(e, $t ($msg.to_string())) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $msg:expr ) => ({ |     ( $t:path, $msg:expr ) => ({ | ||||||
|         |e| cherr!(e, $t ($msg.to_string())) |         |e| cherr!(e, $t ($msg.to_string())) | ||||||
|     }); |     }); | ||||||
|     ( $t:ident, $msg:expr, ) => ({ |  | ||||||
|         |e| cherr!(e, $t ($msg.to_string())) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $msg:expr, ) => ({ |     ( $t:path, $msg:expr, ) => ({ | ||||||
|         |e| cherr!(e, $t ($msg.to_string())) |         |e| cherr!(e, $t ($msg.to_string())) | ||||||
|     }); |     }); | ||||||
|     ( $t:ident, $fmt:expr, $($arg:tt)+ ) => ({ |  | ||||||
|         |e| cherr!(e, $t (format!($fmt, $($arg)+ ))) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $fmt:expr, $($arg:tt)+ ) => ({ |     ( $t:path, $fmt:expr, $($arg:tt)+ ) => ({ | ||||||
|         |e| cherr!(e, $t (format!($fmt, $($arg)+ ))) |         |e| cherr!(e, $t (format!($fmt, $($arg)+ ))) | ||||||
|     }); |     }); | ||||||
|  | @ -854,21 +839,12 @@ macro_rules! mstrerr { | ||||||
| /// ~~~
 | /// ~~~
 | ||||||
| #[macro_export] | #[macro_export] | ||||||
| macro_rules! strerr { | macro_rules! strerr { | ||||||
|     ( $t:ident, $msg:expr ) => ({ |  | ||||||
|         cherr!($t ($msg.to_string())) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $msg:expr ) => ({ |     ( $t:path, $msg:expr ) => ({ | ||||||
|         cherr!($t ($msg.to_string())) |         cherr!($t ($msg.to_string())) | ||||||
|     }); |     }); | ||||||
|     ( $t:ident, $msg:expr, ) => ({ |  | ||||||
|         cherr!($t ($msg.to_string())) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $msg:expr, ) => ({ |     ( $t:path, $msg:expr, ) => ({ | ||||||
|         cherr!($t ($msg.to_string())) |         cherr!($t ($msg.to_string())) | ||||||
|     }); |     }); | ||||||
|     ( $t:ident, $fmt:expr, $($arg:tt)+ ) => ({ |  | ||||||
|         cherr!($t (format!($fmt, $($arg)+ ))) |  | ||||||
|     }); |  | ||||||
|     ( $t:path, $fmt:expr, $($arg:tt)+ ) => ({ |     ( $t:path, $fmt:expr, $($arg:tt)+ ) => ({ | ||||||
|         cherr!($t (format!($fmt, $($arg)+ ))) |         cherr!($t (format!($fmt, $($arg)+ ))) | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Harald Hoyer
						Harald Hoyer