summaryrefslogtreecommitdiff
path: root/utils/src/legacy/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/legacy/input.rs')
-rw-r--r--utils/src/legacy/input.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/utils/src/legacy/input.rs b/utils/src/legacy/input.rs
index 95d53cb..501ce69 100644
--- a/utils/src/legacy/input.rs
+++ b/utils/src/legacy/input.rs
@@ -89,10 +89,7 @@ pub async fn input_with_editor_cutsom(
let status = Command::new(editor).arg(cache_path).status().await?;
if !status.success() {
- return Err(std::io::Error::new(
- std::io::ErrorKind::Other,
- "Editor exited with non-zero status",
- ));
+ return Err(std::io::Error::other("Editor exited with non-zero status"));
}
// Read the modified content
@@ -101,14 +98,7 @@ pub async fn input_with_editor_cutsom(
// Remove comment lines and trim
let processed_content: String = content
.lines()
- .filter_map(|line| {
- let trimmed = line.trim();
- if trimmed.starts_with(comment_prefix) {
- None
- } else {
- Some(line)
- }
- })
+ .filter(|line| !line.trim().starts_with(comment_prefix))
.collect::<Vec<&str>>()
.join("\n");