Skip to content

Commit

Permalink
Avoid reading tmp_file content for validation if there are no validators
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelmello committed Jan 7, 2024
1 parent 5f31a0a commit c2e3086
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inquire/src/prompts/editor/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ impl<'a> EditorPrompt<'a> {
}

fn validate_current_answer(&self) -> InquireResult<Validation> {
if self.validators.is_empty() {
return Ok(Validation::Valid);
}

let cur_answer = self.cur_answer()?;
for validator in &self.validators {
match validator.validate(&cur_answer) {
Expand Down

0 comments on commit c2e3086

Please sign in to comment.