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