Implement run_query() in terms of run_query_iter()
This commit is contained in:
@@ -5,6 +5,7 @@ use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Display;
|
||||
use std::fmt::Write;
|
||||
use std::iter::FromIterator;
|
||||
|
||||
pub type QueryResult = Result<QueryResolution, String>;
|
||||
|
||||
@@ -198,6 +199,14 @@ impl From<Vec<QueryResolutionLine>> for QueryResolution {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromIterator<QueryResolutionLine> for QueryResolution {
|
||||
fn from_iter<I: IntoIterator<Item = QueryResolutionLine>>(iter: I) -> Self {
|
||||
// TODO: Probably a good idea to implement From<Vec<QueryResolutionLine>> based on this
|
||||
// instead.
|
||||
iter.into_iter().collect::<Vec<_>>().into()
|
||||
}
|
||||
}
|
||||
|
||||
fn split_response_string(input: &str) -> Vec<String> {
|
||||
let mut level_bracket = 0;
|
||||
let mut level_parenthesis = 0;
|
||||
|
||||
Reference in New Issue
Block a user