summaryrefslogtreecommitdiffstats
path: root/src/process/help.rs
diff options
context:
space:
mode:
authorTim Oram <dev@mitmaro.ca>2020-10-22 21:44:42 -0230
committerTim Oram <dev@mitmaro.ca>2020-10-22 22:03:30 -0230
commita61c783ed9c699fca1f9ff363d0c4aa129174022 (patch)
treeca86bcdb9cc7dd6b3434e938ae148622b6efb3eb /src/process/help.rs
parent2b5583f1ae3518c439371e8a94800f332fcc0716 (diff)
Use ViewLine::from trait instead of ViewLine::new
The From trait was meant to handle conversion from one type to another, and the ViewLine struct did not take advantage of it. This removes the ViewLine::new function and replaces the existing usages of the function with a simplified version using the From trait. This greatly reduces the complexity of the usages of ViewLine in most cases.
Diffstat (limited to 'src/process/help.rs')
-rw-r--r--src/process/help.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process/help.rs b/src/process/help.rs
index b26067e..f909441 100644
--- a/src/process/help.rs
+++ b/src/process/help.rs
@@ -69,7 +69,7 @@ impl ProcessModule for Help {
impl Help {
pub fn new() -> Self {
let mut no_help_view_data = ViewData::new();
- no_help_view_data.set_content(ViewLine::new(vec![LineSegment::new("Help not available")]));
+ no_help_view_data.set_content(ViewLine::from("Help not available"));
Self {
return_state: None,