Remove pointless map_err calls.
This commit is contained in:
		
							parent
							
								
									05c64f53b1
								
							
						
					
					
						commit
						d20b4a410b
					
				| @ -35,3 +35,9 @@ impl From<&'static str> for CustomError { | ||||
|         CustomError::Static(value) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl From<String> for CustomError { | ||||
|     fn from(value: String) -> Self { | ||||
|         CustomError::Text(value) | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -129,23 +129,12 @@ fn document_org_source<'b, 'g, 'r, 's>( | ||||
|         }) | ||||
|         .collect::<Result<Vec<_>, _>>()?; | ||||
|     for setup_file in setup_files.iter().map(String::as_str) { | ||||
|         let (_, setup_file_settings) = | ||||
|             scan_for_in_buffer_settings(setup_file.into()).map_err(|err| { | ||||
|                 eprintln!("{}", err); | ||||
|                 nom::Err::Error(CustomError::Static( | ||||
|                     "TODO: make this take an owned string so I can dump err.to_string() into it.", | ||||
|                 )) | ||||
|             })?; | ||||
|         let (_, setup_file_settings) = scan_for_in_buffer_settings(setup_file.into())?; | ||||
|         final_settings.extend(setup_file_settings); | ||||
|     } | ||||
|     final_settings.extend(document_settings); | ||||
|     let new_settings = apply_in_buffer_settings(final_settings, context.get_global_settings()) | ||||
|         .map_err(|err| { | ||||
|             eprintln!("{}", err); | ||||
|             nom::Err::Error(CustomError::Static( | ||||
|                 "TODO: make this take an owned string so I can dump err.to_string() into it.", | ||||
|             )) | ||||
|         })?; | ||||
|         .map_err(|err| nom::Err::Error(CustomError::from(err)))?; | ||||
|     let new_context = context.with_global_settings(&new_settings); | ||||
|     let context = &new_context; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander