aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-10 08:06:41 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-10 08:08:18 -0500
commit5ba8dac7ca4e39713228a9571265b857aabd8c41 (patch)
tree817ee3280c17f16aedb9c13a6eb26b8527a4e3f2
parent168a91a9ddc331cd3b8e5c32f7701f2b0973b147 (diff)
downloadvt100-rust-5ba8dac7ca4e39713228a9571265b857aabd8c41.tar.gz
vt100-rust-5ba8dac7ca4e39713228a9571265b857aabd8c41.zip
simplify
-rw-r--r--src/attrs.rs3
-rw-r--r--src/grid.rs4
-rw-r--r--src/term.rs18
3 files changed, 4 insertions, 21 deletions
diff --git a/src/attrs.rs b/src/attrs.rs
index 4b78771..8ba4e7c 100644
--- a/src/attrs.rs
+++ b/src/attrs.rs
@@ -95,7 +95,8 @@ impl Attrs {
other: &Self,
) {
if self != other && self == &Self::default() {
- write!(contents, "{}", crate::term::ClearAttrs::new()).unwrap();
+ write!(contents, "{}", crate::term::ClearAttrs::default())
+ .unwrap();
return;
}
diff --git a/src/grid.rs b/src/grid.rs
index a546c43..2d515ac 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -186,8 +186,8 @@ impl Grid {
write!(
contents,
"{}{}",
- crate::term::ClearAttrs::new(),
- crate::term::ClearScreen::new()
+ crate::term::ClearAttrs::default(),
+ crate::term::ClearScreen::default()
)
.unwrap();
diff --git a/src/term.rs b/src/term.rs
index 074f177..54dfa1d 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -3,12 +3,6 @@
#[derive(Default, Debug)]
pub struct ClearScreen;
-impl ClearScreen {
- pub fn new() -> Self {
- Self::default()
- }
-}
-
impl std::fmt::Display for ClearScreen {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("\x1b[H\x1b[J")
@@ -18,12 +12,6 @@ impl std::fmt::Display for ClearScreen {
#[derive(Default, Debug)]
pub struct CRLF;
-impl CRLF {
- pub fn new() -> Self {
- Self::default()
- }
-}
-
impl std::fmt::Display for CRLF {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("\r\n")
@@ -58,12 +46,6 @@ impl std::fmt::Display for MoveTo {
#[derive(Default, Debug)]
pub struct ClearAttrs;
-impl ClearAttrs {
- pub fn new() -> Self {
- Self::default()
- }
-}
-
impl std::fmt::Display for ClearAttrs {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("\x1b[m")