mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 18:40:46 +08:00
lib: Fix compiler warnings
This commit is contained in:
@@ -132,7 +132,7 @@ pub struct ContextBar {
|
||||
}
|
||||
|
||||
impl ContextBar {
|
||||
pub const PROP_EDIT_MODE: &str = "edit-mode";
|
||||
pub const PROP_EDIT_MODE: &'static str = "edit-mode";
|
||||
|
||||
pub fn new(
|
||||
theme: Theme,
|
||||
|
||||
@@ -182,12 +182,12 @@ pub struct Form {
|
||||
}
|
||||
|
||||
impl Form {
|
||||
pub const CMD_FOCUS_PREVIOUS: &str = "cmd-focus-previous";
|
||||
pub const CMD_FOCUS_NEXT: &str = "cmd-focus-next";
|
||||
pub const CMD_NEWLINE: &str = "cmd-newline";
|
||||
pub const CMD_PASTE: &str = "cmd-paste";
|
||||
pub const CMD_FOCUS_PREVIOUS: &'static str = "cmd-focus-previous";
|
||||
pub const CMD_FOCUS_NEXT: &'static str = "cmd-focus-next";
|
||||
pub const CMD_NEWLINE: &'static str = "cmd-newline";
|
||||
pub const CMD_PASTE: &'static str = "cmd-paste";
|
||||
|
||||
pub const PROP_ID: &str = "prop-id";
|
||||
pub const PROP_ID: &'static str = "prop-id";
|
||||
|
||||
pub fn new(_theme: Theme, inputs: Vec<Box<dyn MockComponent>>) -> Self {
|
||||
let state = FormState::new(Some(0), inputs.len());
|
||||
|
||||
@@ -95,7 +95,7 @@ pub struct Textarea {
|
||||
}
|
||||
|
||||
impl Textarea {
|
||||
pub const PROP_DISPLAY_PROGRESS: &str = "display-progress";
|
||||
pub const PROP_DISPLAY_PROGRESS: &'static str = "display-progress";
|
||||
|
||||
pub fn new(theme: Theme) -> Self {
|
||||
Self {
|
||||
@@ -163,7 +163,10 @@ impl WidgetComponent for Textarea {
|
||||
self.len = body.len();
|
||||
self.height = (layout[0].height - 1) as usize;
|
||||
|
||||
let body: String = body.iter().map(|line| format!("{}\n", line)).collect();
|
||||
let body: String = body.iter().fold(String::new(), |mut body, line| {
|
||||
body.push_str(&format!("{}\n", line));
|
||||
body
|
||||
});
|
||||
|
||||
let paragraph = Paragraph::new(body)
|
||||
.scroll((self.offset as u16, 0))
|
||||
|
||||
Reference in New Issue
Block a user