I thought I’d bring this up since I just mentored another solution in sublist
where the student kept the variable names as _first_list
and _second_list
.
Sublist
#[derive(Debug, PartialEq, Eq)]
pub enum Comparison {
Equal,
Sublist,
Superlist,
Unequal,
}
pub fn sublist<T: PartialEq>(_first_list: &[T], _second_list: &[T]) -> Comparison {
todo!("Determine if the first list is equal to, sublist of, superlist of or unequal to the second list.");
}
Many exercises in the track seem to be attempting to provide code that has no compiler warnings. I can understand situations where multiple functions need to be implemented and you want to be able to test one without getting warnings from another, but in cases where it’s a single function I don’t see the point to starting variable names with _
.
But maybe we should add a comment or automated feedback? (clippy doesn’t seem to mind this)