Skip to content

Commit be78873

Browse files
committed
Remove unnecessary clone calls
1 parent 36fb489 commit be78873

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

src/module.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,24 +217,14 @@ impl Input {
217217
impl From<Input> for Module {
218218
/// Convert the `Input` builder struct into the finished `Module` struct.
219219
fn from(input: Input) -> Self {
220-
// TODO: I suspect that these `clone` calls aren't really necessary, but I don't know Rust
221-
// well enough to figure out the proper solution now.
222-
let mod_type = input.mod_type.clone();
223-
let title = input.title.clone();
224-
let id = input.id().clone();
225-
let file_name = input.file_name().clone();
226-
let include_statement = input.include_statement();
227-
let includes = input.includes.clone();
228-
let text = input.text().clone();
229-
230220
Module {
231-
mod_type,
232-
title,
233-
id,
234-
file_name,
235-
include_statement,
236-
includes,
237-
text,
221+
mod_type: input.mod_type.clone(),
222+
title: input.title.clone(),
223+
id: input.id(),
224+
file_name: input.file_name(),
225+
include_statement: input.include_statement(),
226+
includes: input.includes.clone(),
227+
text: input.text(),
238228
}
239229
}
240230
}

0 commit comments

Comments
 (0)