questions converter: remove src clone
This commit is contained in:
parent
31c02ae8ef
commit
c326fc59d3
@ -117,11 +117,10 @@ pub mod convert_common {
|
|||||||
|
|
||||||
impl From<SourceQuestionsBatch> for Vec<Question> {
|
impl From<SourceQuestionsBatch> for Vec<Question> {
|
||||||
fn from(src: SourceQuestionsBatch) -> Self {
|
fn from(src: SourceQuestionsBatch) -> Self {
|
||||||
let mut result: Vec<Question> = src
|
let mut src = src;
|
||||||
.questions
|
let mut questions: Vec<SourceQuestion> = vec![];
|
||||||
.iter()
|
std::mem::swap(&mut src.questions, &mut questions);
|
||||||
.map(|item| item.clone().into())
|
let mut result: Vec<Question> = questions.into_iter().map(|item| item.into()).collect();
|
||||||
.collect();
|
|
||||||
let batch_info = BatchInfo::from(src);
|
let batch_info = BatchInfo::from(src);
|
||||||
result.iter_mut().for_each(|question| {
|
result.iter_mut().for_each(|question| {
|
||||||
question.batch_info = batch_info.clone();
|
question.batch_info = batch_info.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user