Skip to content

Commit e952489

Browse files
committed
Fix unnecessary rc clone
1 parent d12faa5 commit e952489

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/app.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ impl App<'_> {
467467
&refs,
468468
user_command_number,
469469
self.app_status.view_area,
470-
self.ctx.clone(),
470+
&self.ctx,
471471
) {
472472
Ok(params) => {
473473
self.view = View::of_user_command(
@@ -504,7 +504,7 @@ impl App<'_> {
504504
&refs,
505505
user_command_number,
506506
self.app_status.view_area,
507-
self.ctx.clone(),
507+
&self.ctx,
508508
)
509509
.and_then(exec_user_command);
510510
match result {
@@ -707,9 +707,9 @@ fn build_external_command_parameters(
707707
refs: &[Ref],
708708
user_command_number: usize,
709709
view_area: Rect,
710-
ctx: Rc<AppContext>,
710+
ctx: &AppContext,
711711
) -> Result<ExternalCommandParameters, String> {
712-
let command = extract_user_command_by_number(user_command_number, &ctx)?
712+
let command = extract_user_command_by_number(user_command_number, ctx)?
713713
.commands
714714
.iter()
715715
.map(String::to_string)

src/view/user_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::{
2222
};
2323

2424
type BuildParamsFn =
25-
fn(&Commit, &[Ref], usize, Rect, Rc<AppContext>) -> Result<ExternalCommandParameters, String>;
25+
fn(&Commit, &[Ref], usize, Rect, &AppContext) -> Result<ExternalCommandParameters, String>;
2626

2727
#[derive(Debug)]
2828
pub struct UserCommandView<'a> {
@@ -231,7 +231,7 @@ impl<'a> UserCommandView<'a> {
231231
&refs,
232232
self.user_command_number,
233233
view_area,
234-
self.ctx.clone(),
234+
&self.ctx,
235235
)
236236
.and_then(|params| build_user_command_output_lines(params, self.ctx.clone()))
237237
.unwrap_or_else(|err| {

0 commit comments

Comments
 (0)