aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/attrs.rs2
-rw-r--r--src/grid.rs10
-rw-r--r--src/row.rs20
-rw-r--r--src/screen.rs2
-rw-r--r--src/term.rs2
5 files changed, 17 insertions, 19 deletions
diff --git a/src/attrs.rs b/src/attrs.rs
index e5a2b8e..e5ee3fb 100644
--- a/src/attrs.rs
+++ b/src/attrs.rs
@@ -86,7 +86,7 @@ impl Attrs {
other: &Self,
) {
if self != other && self == &Self::default() {
- crate::term::ClearAttrs::default().write_buf(contents);
+ crate::term::ClearAttrs.write_buf(contents);
return;
}
diff --git a/src/grid.rs b/src/grid.rs
index a9ecfff..fc236bc 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -200,8 +200,8 @@ impl Grid {
&self,
contents: &mut Vec<u8>,
) -> crate::attrs::Attrs {
- crate::term::ClearAttrs::default().write_buf(contents);
- crate::term::ClearScreen::default().write_buf(contents);
+ crate::term::ClearAttrs.write_buf(contents);
+ crate::term::ClearScreen.write_buf(contents);
let mut prev_attrs = crate::attrs::Attrs::default();
let mut prev_pos = Pos::default();
@@ -418,10 +418,10 @@ impl Grid {
end_cell
.attrs()
.write_escape_code_diff(contents, &prev_attrs);
- crate::term::SaveCursor::default().write_buf(contents);
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::SaveCursor.write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
crate::term::EraseChar::new(1).write_buf(contents);
- crate::term::RestoreCursor::default().write_buf(contents);
+ crate::term::RestoreCursor.write_buf(contents);
prev_attrs
.write_escape_code_diff(contents, end_cell.attrs());
}
diff --git a/src/row.rs b/src/row.rs
index b52146c..eb56f4e 100644
--- a/src/row.rs
+++ b/src/row.rs
@@ -167,7 +167,7 @@ impl Row {
prev_attrs = *default_attrs;
}
contents.push(b' ');
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
crate::term::EraseChar::new(1).write_buf(contents);
prev_pos = crate::grid::Pos { row, col: 0 };
}
@@ -203,8 +203,7 @@ impl Row {
);
} else {
contents.extend(b" ");
- crate::term::Backspace::default()
- .write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
}
} else {
crate::term::MoveFromTo::new(prev_pos, new_pos)
@@ -262,7 +261,7 @@ impl Row {
);
} else {
contents.extend(b" ");
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
}
} else {
crate::term::MoveFromTo::new(prev_pos, new_pos)
@@ -273,7 +272,7 @@ impl Row {
attrs.write_escape_code_diff(contents, &prev_attrs);
prev_attrs = *attrs;
}
- crate::term::ClearRowForward::default().write_buf(contents);
+ crate::term::ClearRowForward.write_buf(contents);
}
(prev_pos, prev_attrs)
@@ -319,9 +318,9 @@ impl Row {
false
};
contents.extend(cell_contents.as_bytes());
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
if prev_first_cell.is_wide() {
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
}
if need_erase {
crate::term::EraseChar::new(1).write_buf(contents);
@@ -361,8 +360,7 @@ impl Row {
);
} else {
contents.extend(b" ");
- crate::term::Backspace::default()
- .write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
}
} else {
crate::term::MoveFromTo::new(prev_pos, new_pos)
@@ -419,7 +417,7 @@ impl Row {
);
} else {
contents.extend(b" ");
- crate::term::Backspace::default().write_buf(contents);
+ crate::term::Backspace.write_buf(contents);
}
} else {
crate::term::MoveFromTo::new(prev_pos, new_pos)
@@ -430,7 +428,7 @@ impl Row {
attrs.write_escape_code_diff(contents, &prev_attrs);
prev_attrs = *attrs;
}
- crate::term::ClearRowForward::default().write_buf(contents);
+ crate::term::ClearRowForward.write_buf(contents);
}
// if this row is going from wrapped to not wrapped, we need to erase
diff --git a/src/screen.rs b/src/screen.rs
index 6eeb2e3..73b904e 100644
--- a/src/screen.rs
+++ b/src/screen.rs
@@ -523,7 +523,7 @@ impl Screen {
}
fn write_attributes_formatted(&self, contents: &mut Vec<u8>) {
- crate::term::ClearAttrs::default().write_buf(contents);
+ crate::term::ClearAttrs.write_buf(contents);
self.attrs.write_escape_code_diff(
contents,
&crate::attrs::Attrs::default(),
diff --git a/src/term.rs b/src/term.rs
index 99ca266..33a9d18 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -365,7 +365,7 @@ impl MoveFromTo {
impl BufWrite for MoveFromTo {
fn write_buf(&self, buf: &mut Vec<u8>) {
if self.to.row == self.from.row + 1 && self.to.col == 0 {
- crate::term::Crlf::default().write_buf(buf);
+ crate::term::Crlf.write_buf(buf);
} else if self.from.row == self.to.row && self.from.col < self.to.col
{
crate::term::MoveRight::new(self.to.col - self.from.col)