Makes Clippy happy

pull/255/head
Tpt 2 years ago committed by Thomas Tanon
parent 73bc18e5bd
commit c1d2cf030d
  1. 10
      lib/oxrdf/src/dataset.rs
  2. 1
      lib/src/io/read.rs
  3. 40
      lib/src/sparql/eval.rs
  4. 2
      lib/src/sparql/model.rs
  5. 41
      lib/src/sparql/plan_builder.rs
  6. 8
      lib/src/xsd/date_time.rs
  7. 13
      lib/src/xsd/decimal.rs
  8. 4
      lib/tests/store.rs

@ -539,14 +539,14 @@ impl Dataset {
} }
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
if let InternedSubject::Triple(triple) = s { if let InternedSubject::Triple(triple) = s {
self.triple_blank_nodes(triple, &mut bnodes); Self::triple_blank_nodes(triple, &mut bnodes);
} }
if let InternedTerm::BlankNode(bnode) = o { if let InternedTerm::BlankNode(bnode) = o {
bnodes.insert(*bnode); bnodes.insert(*bnode);
} }
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
if let InternedTerm::Triple(triple) = o { if let InternedTerm::Triple(triple) = o {
self.triple_blank_nodes(triple, &mut bnodes); Self::triple_blank_nodes(triple, &mut bnodes);
} }
if let InternedGraphName::BlankNode(bnode) = g { if let InternedGraphName::BlankNode(bnode) = g {
bnodes.insert(*bnode); bnodes.insert(*bnode);
@ -556,16 +556,16 @@ impl Dataset {
} }
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
fn triple_blank_nodes(&self, triple: &InternedTriple, bnodes: &mut HashSet<InternedBlankNode>) { fn triple_blank_nodes(triple: &InternedTriple, bnodes: &mut HashSet<InternedBlankNode>) {
if let InternedSubject::BlankNode(bnode) = &triple.subject { if let InternedSubject::BlankNode(bnode) = &triple.subject {
bnodes.insert(*bnode); bnodes.insert(*bnode);
} else if let InternedSubject::Triple(t) = &triple.subject { } else if let InternedSubject::Triple(t) = &triple.subject {
self.triple_blank_nodes(t, bnodes); Self::triple_blank_nodes(t, bnodes);
} }
if let InternedTerm::BlankNode(bnode) = &triple.object { if let InternedTerm::BlankNode(bnode) = &triple.object {
bnodes.insert(*bnode); bnodes.insert(*bnode);
} else if let InternedTerm::Triple(t) = &triple.object { } else if let InternedTerm::Triple(t) = &triple.object {
self.triple_blank_nodes(t, bnodes); Self::triple_blank_nodes(t, bnodes);
} }
} }

@ -109,6 +109,7 @@ pub struct TripleReader<R: BufRead> {
buffer: Vec<Triple>, buffer: Vec<Triple>,
} }
#[allow(clippy::large_enum_variant)]
enum TripleReaderKind<R: BufRead> { enum TripleReaderKind<R: BufRead> {
NTriples(NTriplesParser<R>), NTriples(NTriplesParser<R>),
Turtle(TurtleParser<R>), Turtle(TurtleParser<R>),

@ -1484,7 +1484,7 @@ impl SimpleEvaluator {
Rc::new(move |tuple| { Rc::new(move |tuple| {
let (arg1, arg2, _) = let (arg1, arg2, _) =
to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?; to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?;
Some((&arg1).starts_with(arg2.as_str()).into()) Some(arg1.starts_with(arg2.as_str()).into())
}) })
} }
PlanExpression::EncodeForUri(ltrl) => { PlanExpression::EncodeForUri(ltrl) => {
@ -1528,7 +1528,7 @@ impl SimpleEvaluator {
Rc::new(move |tuple| { Rc::new(move |tuple| {
let (arg1, arg2, _) = let (arg1, arg2, _) =
to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?; to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?;
Some((&arg1).ends_with(arg2.as_str()).into()) Some(arg1.ends_with(arg2.as_str()).into())
}) })
} }
PlanExpression::Contains(arg1, arg2) => { PlanExpression::Contains(arg1, arg2) => {
@ -1538,7 +1538,7 @@ impl SimpleEvaluator {
Rc::new(move |tuple| { Rc::new(move |tuple| {
let (arg1, arg2, _) = let (arg1, arg2, _) =
to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?; to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?;
Some((&arg1).contains(arg2.as_str()).into()) Some(arg1.contains(arg2.as_str()).into())
}) })
} }
PlanExpression::StrBefore(arg1, arg2) => { PlanExpression::StrBefore(arg1, arg2) => {
@ -1548,7 +1548,7 @@ impl SimpleEvaluator {
Rc::new(move |tuple| { Rc::new(move |tuple| {
let (arg1, arg2, language) = let (arg1, arg2, language) =
to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?; to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?;
Some(if let Some(position) = (&arg1).find(arg2.as_str()) { Some(if let Some(position) = arg1.find(arg2.as_str()) {
build_plain_literal(&dataset, &arg1[..position], language) build_plain_literal(&dataset, &arg1[..position], language)
} else { } else {
build_string_literal(&dataset, "") build_string_literal(&dataset, "")
@ -1562,7 +1562,7 @@ impl SimpleEvaluator {
Rc::new(move |tuple| { Rc::new(move |tuple| {
let (arg1, arg2, language) = let (arg1, arg2, language) =
to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?; to_argument_compatible_strings(&dataset, &arg1(tuple)?, &arg2(tuple)?)?;
Some(if let Some(position) = (&arg1).find(arg2.as_str()) { Some(if let Some(position) = arg1.find(arg2.as_str()) {
build_plain_literal(&dataset, &arg1[position + arg2.len()..], language) build_plain_literal(&dataset, &arg1[position + arg2.len()..], language)
} else { } else {
build_string_literal(&dataset, "") build_string_literal(&dataset, "")
@ -1858,7 +1858,7 @@ impl SimpleEvaluator {
EncodedTerm::DecimalLiteral(value) => Some(value.to_bool().into()), EncodedTerm::DecimalLiteral(value) => Some(value.to_bool().into()),
EncodedTerm::SmallStringLiteral(value) => parse_boolean_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_boolean_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_boolean_str(&*dataset.get_str(&value_id).ok()??) parse_boolean_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1876,7 +1876,7 @@ impl SimpleEvaluator {
} }
EncodedTerm::SmallStringLiteral(value) => parse_double_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_double_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_double_str(&*dataset.get_str(&value_id).ok()??) parse_double_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1894,7 +1894,7 @@ impl SimpleEvaluator {
} }
EncodedTerm::SmallStringLiteral(value) => parse_float_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_float_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_float_str(&*dataset.get_str(&value_id).ok()??) parse_float_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1907,10 +1907,10 @@ impl SimpleEvaluator {
EncodedTerm::DoubleLiteral(value) => Some(value.to_i64().into()), EncodedTerm::DoubleLiteral(value) => Some(value.to_i64().into()),
EncodedTerm::IntegerLiteral(value) => Some(value.into()), EncodedTerm::IntegerLiteral(value) => Some(value.into()),
EncodedTerm::DecimalLiteral(value) => Some(i64::try_from(value).ok()?.into()), EncodedTerm::DecimalLiteral(value) => Some(i64::try_from(value).ok()?.into()),
EncodedTerm::BooleanLiteral(value) => Some(if value { 1 } else { 0 }.into()), EncodedTerm::BooleanLiteral(value) => Some(i64::from(value).into()),
EncodedTerm::SmallStringLiteral(value) => parse_integer_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_integer_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_integer_str(&*dataset.get_str(&value_id).ok()??) parse_integer_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1923,12 +1923,10 @@ impl SimpleEvaluator {
EncodedTerm::DoubleLiteral(value) => Some(Decimal::from_double(value).into()), EncodedTerm::DoubleLiteral(value) => Some(Decimal::from_double(value).into()),
EncodedTerm::IntegerLiteral(value) => Some(Decimal::from(value).into()), EncodedTerm::IntegerLiteral(value) => Some(Decimal::from(value).into()),
EncodedTerm::DecimalLiteral(value) => Some(value.into()), EncodedTerm::DecimalLiteral(value) => Some(value.into()),
EncodedTerm::BooleanLiteral(value) => { EncodedTerm::BooleanLiteral(value) => Some(Decimal::from(value).into()),
Some(Decimal::from(if value { 1 } else { 0 }).into())
}
EncodedTerm::SmallStringLiteral(value) => parse_decimal_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_decimal_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_decimal_str(&*dataset.get_str(&value_id).ok()??) parse_decimal_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1941,7 +1939,7 @@ impl SimpleEvaluator {
EncodedTerm::DateTimeLiteral(value) => Some(Date::try_from(value).ok()?.into()), EncodedTerm::DateTimeLiteral(value) => Some(Date::try_from(value).ok()?.into()),
EncodedTerm::SmallStringLiteral(value) => parse_date_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_date_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_date_str(&*dataset.get_str(&value_id).ok()??) parse_date_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1954,7 +1952,7 @@ impl SimpleEvaluator {
EncodedTerm::DateTimeLiteral(value) => Some(Time::try_from(value).ok()?.into()), EncodedTerm::DateTimeLiteral(value) => Some(Time::try_from(value).ok()?.into()),
EncodedTerm::SmallStringLiteral(value) => parse_time_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_time_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_time_str(&*dataset.get_str(&value_id).ok()??) parse_time_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1967,7 +1965,7 @@ impl SimpleEvaluator {
EncodedTerm::DateLiteral(value) => Some(DateTime::try_from(value).ok()?.into()), EncodedTerm::DateLiteral(value) => Some(DateTime::try_from(value).ok()?.into()),
EncodedTerm::SmallStringLiteral(value) => parse_date_time_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_date_time_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_date_time_str(&*dataset.get_str(&value_id).ok()??) parse_date_time_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -1985,7 +1983,7 @@ impl SimpleEvaluator {
} }
EncodedTerm::SmallStringLiteral(value) => parse_duration_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_duration_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_duration_str(&*dataset.get_str(&value_id).ok()??) parse_duration_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -2000,7 +1998,7 @@ impl SimpleEvaluator {
EncodedTerm::YearMonthDurationLiteral(value) => Some(value.into()), EncodedTerm::YearMonthDurationLiteral(value) => Some(value.into()),
EncodedTerm::SmallStringLiteral(value) => parse_year_month_duration_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_year_month_duration_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_year_month_duration_str(&*dataset.get_str(&value_id).ok()??) parse_year_month_duration_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -2015,7 +2013,7 @@ impl SimpleEvaluator {
EncodedTerm::DayTimeDurationLiteral(value) => Some(value.into()), EncodedTerm::DayTimeDurationLiteral(value) => Some(value.into()),
EncodedTerm::SmallStringLiteral(value) => parse_day_time_duration_str(&value), EncodedTerm::SmallStringLiteral(value) => parse_day_time_duration_str(&value),
EncodedTerm::BigStringLiteral { value_id } => { EncodedTerm::BigStringLiteral { value_id } => {
parse_day_time_duration_str(&*dataset.get_str(&value_id).ok()??) parse_day_time_duration_str(&dataset.get_str(&value_id).ok()??)
} }
_ => None, _ => None,
}) })
@ -3292,7 +3290,7 @@ impl Iterator for ConsecutiveDeduplication {
fn size_hint(&self) -> (usize, Option<usize>) { fn size_hint(&self) -> (usize, Option<usize>) {
let (min, max) = self.inner.size_hint(); let (min, max) = self.inner.size_hint();
(if min == 0 { 0 } else { 1 }, max) ((min != 0).into(), max)
} }
} }

@ -190,7 +190,7 @@ impl QuerySolutionIter {
/// ``` /// ```
#[inline] #[inline]
pub fn variables(&self) -> &[Variable] { pub fn variables(&self) -> &[Variable] {
&*self.variables &self.variables
} }
} }

@ -102,7 +102,7 @@ impl<'a> PlanBuilder<'a> {
let right = self.build_for_graph_pattern(right, variables, graph_name)?; let right = self.build_for_graph_pattern(right, variables, graph_name)?;
let mut possible_problem_vars = BTreeSet::new(); let mut possible_problem_vars = BTreeSet::new();
self.add_left_join_problematic_variables(&right, &mut possible_problem_vars); Self::add_left_join_problematic_variables(&right, &mut possible_problem_vars);
//We add the extra filter if needed //We add the extra filter if needed
let right = if let Some(expr) = expression { let right = if let Some(expr) = expression {
@ -182,7 +182,7 @@ impl<'a> PlanBuilder<'a> {
} => { } => {
let mut inner_variables = by.clone(); let mut inner_variables = by.clone();
let inner_graph_name = let inner_graph_name =
self.convert_pattern_value_id(graph_name, variables, &mut inner_variables); Self::convert_pattern_value_id(graph_name, variables, &mut inner_variables);
PlanNode::Aggregate { PlanNode::Aggregate {
child: Box::new(self.build_for_graph_pattern( child: Box::new(self.build_for_graph_pattern(
@ -242,7 +242,7 @@ impl<'a> PlanBuilder<'a> {
} => { } => {
let mut inner_variables = projection.clone(); let mut inner_variables = projection.clone();
let inner_graph_name = let inner_graph_name =
self.convert_pattern_value_id(graph_name, variables, &mut inner_variables); Self::convert_pattern_value_id(graph_name, variables, &mut inner_variables);
PlanNode::Project { PlanNode::Project {
child: Box::new(self.build_for_graph_pattern( child: Box::new(self.build_for_graph_pattern(
inner, inner,
@ -1034,7 +1034,6 @@ impl<'a> PlanBuilder<'a> {
} }
fn convert_pattern_value_id( fn convert_pattern_value_id(
&self,
from_value: &PatternValue, from_value: &PatternValue,
from: &[Variable], from: &[Variable],
to: &mut Vec<Variable>, to: &mut Vec<Variable>,
@ -1045,9 +1044,9 @@ impl<'a> PlanBuilder<'a> {
PatternValue::Variable(Self::convert_variable_id(*from_id, from, to)) PatternValue::Variable(Self::convert_variable_id(*from_id, from, to))
} }
PatternValue::Triple(triple) => PatternValue::Triple(Box::new(TriplePatternValue { PatternValue::Triple(triple) => PatternValue::Triple(Box::new(TriplePatternValue {
subject: self.convert_pattern_value_id(&triple.subject, from, to), subject: Self::convert_pattern_value_id(&triple.subject, from, to),
predicate: self.convert_pattern_value_id(&triple.predicate, from, to), predicate: Self::convert_pattern_value_id(&triple.predicate, from, to),
object: self.convert_pattern_value_id(&triple.object, from, to), object: Self::convert_pattern_value_id(&triple.object, from, to),
})), })),
} }
} }
@ -1067,7 +1066,7 @@ impl<'a> PlanBuilder<'a> {
} }
} }
fn add_left_join_problematic_variables(&self, node: &PlanNode, set: &mut BTreeSet<usize>) { fn add_left_join_problematic_variables(node: &PlanNode, set: &mut BTreeSet<usize>) {
match node { match node {
PlanNode::StaticBindings { .. } PlanNode::StaticBindings { .. }
| PlanNode::QuadPattern { .. } | PlanNode::QuadPattern { .. }
@ -1079,22 +1078,22 @@ impl<'a> PlanBuilder<'a> {
set.insert(v); set.insert(v);
} }
}); });
self.add_left_join_problematic_variables(child, set); Self::add_left_join_problematic_variables(child, set);
} }
PlanNode::Union { children } => { PlanNode::Union { children } => {
for child in children.iter() { for child in children.iter() {
self.add_left_join_problematic_variables(child, set); Self::add_left_join_problematic_variables(child, set);
} }
} }
PlanNode::HashJoin { left, right } | PlanNode::ForLoopJoin { left, right } => { PlanNode::HashJoin { left, right } | PlanNode::ForLoopJoin { left, right } => {
self.add_left_join_problematic_variables(left, set); Self::add_left_join_problematic_variables(left, set);
self.add_left_join_problematic_variables(right, set); Self::add_left_join_problematic_variables(right, set);
} }
PlanNode::AntiJoin { left, .. } => { PlanNode::AntiJoin { left, .. } => {
self.add_left_join_problematic_variables(left, set); Self::add_left_join_problematic_variables(left, set);
} }
PlanNode::LeftJoin { left, right, .. } => { PlanNode::LeftJoin { left, right, .. } => {
self.add_left_join_problematic_variables(left, set); Self::add_left_join_problematic_variables(left, set);
right.lookup_used_variables(&mut |v| { right.lookup_used_variables(&mut |v| {
set.insert(v); set.insert(v);
}); });
@ -1108,26 +1107,28 @@ impl<'a> PlanBuilder<'a> {
set.insert(v); set.insert(v);
} }
}); });
self.add_left_join_problematic_variables(child, set); Self::add_left_join_problematic_variables(child, set);
self.add_left_join_problematic_variables(child, set); Self::add_left_join_problematic_variables(child, set);
} }
PlanNode::Sort { child, .. } PlanNode::Sort { child, .. }
| PlanNode::HashDeduplicate { child } | PlanNode::HashDeduplicate { child }
| PlanNode::Reduced { child } | PlanNode::Reduced { child }
| PlanNode::Skip { child, .. } | PlanNode::Skip { child, .. }
| PlanNode::Limit { child, .. } => self.add_left_join_problematic_variables(child, set), | PlanNode::Limit { child, .. } => {
Self::add_left_join_problematic_variables(child, set)
}
PlanNode::Service { child, silent, .. } => { PlanNode::Service { child, silent, .. } => {
if *silent { if *silent {
child.lookup_used_variables(&mut |v| { child.lookup_used_variables(&mut |v| {
set.insert(v); set.insert(v);
}); });
} else { } else {
self.add_left_join_problematic_variables(child, set) Self::add_left_join_problematic_variables(child, set)
} }
} }
PlanNode::Project { mapping, child } => { PlanNode::Project { mapping, child } => {
let mut child_bound = BTreeSet::new(); let mut child_bound = BTreeSet::new();
self.add_left_join_problematic_variables(child, &mut child_bound); Self::add_left_join_problematic_variables(child, &mut child_bound);
for (child_i, output_i) in mapping.iter() { for (child_i, output_i) in mapping.iter() {
if child_bound.contains(child_i) { if child_bound.contains(child_i) {
set.insert(*output_i); set.insert(*output_i);
@ -1367,7 +1368,7 @@ fn sort_bgp(p: &[TriplePattern]) -> Vec<&TriplePattern> {
let mut new_p: Vec<_> = p.iter().collect(); let mut new_p: Vec<_> = p.iter().collect();
for i in 0..new_p.len() { for i in 0..new_p.len() {
(&mut new_p[i..]).sort_by(|p1, p2| { new_p[i..].sort_by(|p1, p2| {
estimate_pattern_cost(p1, &assigned_variables, &assigned_blank_nodes).cmp( estimate_pattern_cost(p1, &assigned_variables, &assigned_blank_nodes).cmp(
&estimate_pattern_cost(p2, &assigned_variables, &assigned_blank_nodes), &estimate_pattern_cost(p2, &assigned_variables, &assigned_blank_nodes),
) )

@ -1234,12 +1234,8 @@ impl Timestamp {
let year = let year =
(400 * year_mul_400 + 100 * year_mul_100 + 4 * year_mul_4 + year_mod_4 + shift) as i64; (400 * year_mul_400 + 100 * year_mul_100 + 4 * year_mul_4 + year_mod_4 + shift) as i64;
let leap_year_offset = if (year_mul_100 == 0 || year_mul_4 != 0) && year_mod_4 == 0 { let is_leap_year = (year_mul_100 == 0 || year_mul_4 != 0) && year_mod_4 == 0;
1 days += i128::from(is_leap_year);
} else {
0
};
days += leap_year_offset;
let mut month = 0; let mut month = 0;
for month_i in 1..=12 { for month_i in 1..=12 {

@ -113,9 +113,9 @@ impl Decimal {
let value = self.value / DECIMAL_PART_POW_MINUS_ONE; let value = self.value / DECIMAL_PART_POW_MINUS_ONE;
Self { Self {
value: if value >= 0 { value: if value >= 0 {
(value / 10 + if value % 10 >= 5 { 1 } else { 0 }) * DECIMAL_PART_POW (value / 10 + i128::from(value % 10 >= 5)) * DECIMAL_PART_POW
} else { } else {
(value / 10 + if -value % 10 > 5 { -1 } else { 0 }) * DECIMAL_PART_POW (value / 10 - i128::from(-value % 10 > 5)) * DECIMAL_PART_POW
}, },
} }
} }
@ -210,6 +210,15 @@ impl Decimal {
} }
} }
impl From<bool> for Decimal {
#[inline]
fn from(value: bool) -> Self {
Self {
value: i128::from(value) * DECIMAL_PART_POW,
}
}
}
impl From<i8> for Decimal { impl From<i8> for Decimal {
#[inline] #[inline]
fn from(value: i8) -> Self { fn from(value: i8) -> Self {

@ -356,11 +356,11 @@ fn test_backward_compatibility() -> Result<(), Box<dyn Error>> {
fn reset_dir(dir: &str) -> Result<(), Box<dyn Error>> { fn reset_dir(dir: &str) -> Result<(), Box<dyn Error>> {
assert!(Command::new("git") assert!(Command::new("git")
.args(&["clean", "-fX", dir]) .args(["clean", "-fX", dir])
.status()? .status()?
.success()); .success());
assert!(Command::new("git") assert!(Command::new("git")
.args(&["checkout", "HEAD", "--", dir]) .args(["checkout", "HEAD", "--", dir])
.status()? .status()?
.success()); .success());
Ok(()) Ok(())

Loading…
Cancel
Save