summaryrefslogtreecommitdiffstats
path: root/examples/editor
diff options
context:
space:
mode:
Diffstat (limited to 'examples/editor')
-rw-r--r--examples/editor/src/main.rs19
1 files changed, 1 insertions, 18 deletions
diff --git a/examples/editor/src/main.rs b/examples/editor/src/main.rs
index f49ca6e8..a69e1f54 100644
--- a/examples/editor/src/main.rs
+++ b/examples/editor/src/main.rs
@@ -114,25 +114,8 @@ impl Application for Editor {
} else {
self.is_loading = true;
- let mut contents = self.content.lines().enumerate().fold(
- String::new(),
- |mut contents, (i, line)| {
- if i > 0 {
- contents.push('\n');
- }
-
- contents.push_str(&line);
-
- contents
- },
- );
-
- if !contents.ends_with('\n') {
- contents.push('\n');
- }
-
Command::perform(
- save_file(self.file.clone(), contents),
+ save_file(self.file.clone(), self.content.text()),
Message::FileSaved,
)
}