mirror of
https://github.com/extrawurst/gitui.git
synced 2024-12-28 19:44:14 +03:00
&str instead of weird &String
This commit is contained in:
parent
6f2157c1d8
commit
aaf0e4cfbf
@ -179,7 +179,7 @@ impl CommitComponent {
|
||||
anyhow::bail!("config commit.gpgsign=true detected.\ngpg signing not supported.\ndeactivate in your repo/gitconfig to be able to commit without signing.");
|
||||
}
|
||||
|
||||
let msg = self.input.get_text().clone();
|
||||
let msg = self.input.get_text().to_string();
|
||||
self.input.clear();
|
||||
self.commit_with_msg(msg)
|
||||
}
|
||||
|
@ -122,8 +122,7 @@ impl CreateBranchComponent {
|
||||
|
||||
///
|
||||
pub fn create_branch(&mut self) {
|
||||
let res =
|
||||
sync::create_branch(CWD, self.input.get_text().as_str());
|
||||
let res = sync::create_branch(CWD, self.input.get_text());
|
||||
|
||||
self.input.clear();
|
||||
self.hide();
|
||||
|
@ -119,7 +119,7 @@ impl Component for CredComponent {
|
||||
Some(
|
||||
self.input_username
|
||||
.get_text()
|
||||
.clone(),
|
||||
.to_string(),
|
||||
),
|
||||
None,
|
||||
);
|
||||
@ -131,7 +131,7 @@ impl Component for CredComponent {
|
||||
Some(
|
||||
self.input_password
|
||||
.get_text()
|
||||
.clone(),
|
||||
.to_string(),
|
||||
),
|
||||
);
|
||||
self.input_password.hide();
|
||||
|
@ -127,11 +127,8 @@ impl RenameBranchComponent {
|
||||
///
|
||||
pub fn rename_branch(&mut self) {
|
||||
if let Some(br) = &self.branch_ref {
|
||||
let res = sync::rename_branch(
|
||||
CWD,
|
||||
br,
|
||||
self.input.get_text().as_str(),
|
||||
);
|
||||
let res =
|
||||
sync::rename_branch(CWD, br, self.input.get_text());
|
||||
|
||||
match res {
|
||||
Ok(_) => {
|
||||
|
@ -68,7 +68,7 @@ impl Component for StashMsgComponent {
|
||||
if self.input.get_text().is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(self.input.get_text().as_str())
|
||||
Some(self.input.get_text())
|
||||
},
|
||||
self.options.stash_untracked,
|
||||
self.options.keep_index,
|
||||
|
@ -81,8 +81,8 @@ impl TextInputComponent {
|
||||
}
|
||||
|
||||
/// Get the `msg`.
|
||||
pub const fn get_text(&self) -> &String {
|
||||
&self.msg
|
||||
pub fn get_text(&self) -> &str {
|
||||
self.msg.as_str()
|
||||
}
|
||||
|
||||
/// screen area (last time we got drawn)
|
||||
|
Loading…
Reference in New Issue
Block a user