mirror of
				https://github.com/haraldh/chainerror.git
				synced 2025-11-04 08:18:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			309 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			309 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# Deref for the ErrorKind
 | 
						|
 | 
						|
Because ChainError<T> implements Deref to &T, we can also match on `*e` instead of `e.kind()`
 | 
						|
or call a function with `&e`
 | 
						|
~~~rust
 | 
						|
use crate::chainerror::*;
 | 
						|
{{#include ../examples/tutorial12.rs:2:}}
 | 
						|
# #[allow(dead_code)]
 | 
						|
# mod chainerror {
 | 
						|
{{#includecomment ../src/lib.rs}}
 | 
						|
# }
 | 
						|
~~~
 |