Skip to content

Commit

Permalink
fix: change if statement to let Some,
Browse files Browse the repository at this point in the history
remove unnecessary import
  • Loading branch information
piragi committed Jan 14, 2022
1 parent ade82b0 commit 5efc48e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ pub enum HtmlMathmode {
impl Config {
/// [`validate_config`] validates if file and paths exist and if config does not contradict itself
pub fn validate_config(&mut self) -> Result<(), UmError> {
if self.out_file.is_some() {
if !self.out_file.as_ref().unwrap().exists() {
if let Some(ref file) = self.out_file {
if !file.exists() {
let msg = format!(
"output_file: {} is not a valid file",
self.out_file.as_ref().unwrap().to_str().unwrap()
file.to_string_lossy()
);
return Err(UmError::Backend(BackendError::new(msg)));
} else if !self.overwrite_out_files {
Expand Down
1 change: 0 additions & 1 deletion src/frontend/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use pest::{iterators::Pair, iterators::Pairs, Parser, Span};
use pest_derive::Parser;
use std::fs;

use crate::config;
use crate::um_error::UmError;
use crate::{
config::Config,
Expand Down

0 comments on commit 5efc48e

Please sign in to comment.