Skip to content

Commit 3bdaef4

Browse files
committed
Use idiomatic Rc::clone
1 parent 308e646 commit 3bdaef4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/handlers.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ impl IntoNativeHandlers<NativeElementContentHandlers<'static>> for ElementConten
7777
let mut native = NativeElementContentHandlers::default();
7878

7979
if let Some(handler) = self.element() {
80-
let this = handlers.clone();
80+
let this = Rc::clone(&handlers);
8181
native = native.element(make_handler!(handler, Element, this, stack_ptr));
8282
}
8383

8484
if let Some(handler) = self.comments() {
85-
let this = handlers.clone();
85+
let this = Rc::clone(&handlers);
8686
native = native.comments(make_handler!(handler, Comment, this, stack_ptr));
8787
}
8888

8989
if let Some(handler) = self.text() {
90-
let this = handlers.clone();
90+
let this = Rc::clone(&handlers);
9191
native = native.text(make_handler!(handler, TextChunk, this, stack_ptr));
9292
}
9393

@@ -118,22 +118,22 @@ impl IntoNativeHandlers<NativeDocumentContentHandlers<'static>> for DocumentCont
118118
let mut native = NativeDocumentContentHandlers::default();
119119

120120
if let Some(handler) = self.doctype() {
121-
let this = handlers.clone();
121+
let this = Rc::clone(&handlers);
122122
native = native.doctype(make_handler!(handler, Doctype, this, stack_ptr));
123123
}
124124

125125
if let Some(handler) = self.comments() {
126-
let this = handlers.clone();
126+
let this = Rc::clone(&handlers);
127127
native = native.comments(make_handler!(handler, Comment, this, stack_ptr));
128128
}
129129

130130
if let Some(handler) = self.text() {
131-
let this = handlers.clone();
131+
let this = Rc::clone(&handlers);
132132
native = native.text(make_handler!(handler, TextChunk, this, stack_ptr));
133133
}
134134

135135
if let Some(handler) = self.end() {
136-
let this = handlers.clone();
136+
let this = Rc::clone(&handlers);
137137
native = native.end(make_handler!(handler, DocumentEnd, this, stack_ptr));
138138
}
139139

0 commit comments

Comments
 (0)