Browse Source

replace clone with copy

master
yggverse 4 weeks ago
parent
commit
07ee9cba07
  1. 2
      src/app/browser/window/tab/item/page/meta.rs
  2. 6
      src/app/browser/window/tab/item/page/navigation/history.rs

2
src/app/browser/window/tab/item/page/meta.rs

@ -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!

6
src/app/browser/window/tab/item/page/navigation/history.rs

@ -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 {

Loading…
Cancel
Save