replace clone with copy

This commit is contained in:
yggverse 2024-11-08 05:35:32 +02:00
parent 164cddac5a
commit 07ee9cba07
2 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ impl Meta {
} }
pub fn redirect_count(&self) -> Option<i8> { pub fn redirect_count(&self) -> Option<i8> {
self.redirect_count.borrow().clone() *self.redirect_count.borrow()
} }
/// WARNING! /// WARNING!

View File

@ -73,7 +73,7 @@ impl History {
} }
pub fn back(&self, follow_to_index: bool) -> Option<GString> { pub fn back(&self, follow_to_index: bool) -> Option<GString> {
let index = self.index.borrow().clone(); // keep outside as borrow let index = *self.index.borrow();
if let Some(usize) = index { if let Some(usize) = index {
// Make sure value positive to prevent panic // Make sure value positive to prevent panic
if usize > 0 { if usize > 0 {
@ -89,7 +89,7 @@ impl History {
} }
pub fn current(&self) -> Option<GString> { pub fn current(&self) -> Option<GString> {
let index = self.index.borrow().clone(); // keep outside as borrow let index = *self.index.borrow();
if let Some(usize) = index { if let Some(usize) = index {
if let Some(memory) = self.memory.borrow().get(usize) { if let Some(memory) = self.memory.borrow().get(usize) {
return Some(memory.request.clone()); return Some(memory.request.clone());
@ -99,7 +99,7 @@ impl History {
} }
pub fn forward(&self, follow_to_index: bool) -> Option<GString> { pub fn forward(&self, follow_to_index: bool) -> Option<GString> {
let index = self.index.borrow().clone(); // keep outside as borrow let index = *self.index.borrow();
if let Some(usize) = index { if let Some(usize) = index {
if let Some(memory) = self.memory.borrow().get(usize + 1) { if let Some(memory) = self.memory.borrow().get(usize + 1) {
if follow_to_index { if follow_to_index {