Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FP
ghostcell
Commits
dfe86ff3
Commit
dfe86ff3
authored
Feb 25, 2021
by
Hai Dang
Browse files
remove clone in dlist_arc iter_immut
parent
579c5102
Pipeline
#42444
passed with stage
in 23 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ghostcell/src/dlist_arc.rs
View file @
dfe86ff3
...
...
@@ -102,11 +102,11 @@ impl<'id, T> Node<'id, T> {
token
:
&
GhostToken
<
'id
>
,
f
:
impl
Fn
(
&
T
),
)
{
let
mut
cur
:
Option
<
Node
Ptr
<
'id
,
T
>>
=
Some
(
node
.
clone
());
let
mut
cur
:
Option
<
&
GhostCell
<
'id
,
Node
<
'id
,
T
>>
>
=
Some
(
node
.
as_ref
());
while
let
Some
(
node
)
=
cur
{
let
node
:
&
Node
<
'id
,
T
>
=
node
.borrow
(
token
);
// immutably borrow `node` with `token`
f
(
&
node
.data
);
cur
=
node
.next
.
clone
();
cur
=
node
.next
.
as_deref
();
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment