mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
replace clone with copy
This commit is contained in:
parent
164cddac5a
commit
07ee9cba07
@ -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!
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user