}
impl TypeComplexity {
+ #[must_use]
pub fn new(threshold: u64) -> Self {
Self { threshold }
}
impl FullInt {
#[allow(clippy::cast_sign_loss)]
+ #[must_use]
fn cmp_s_u(s: i128, u: u128) -> Ordering {
if s < 0 {
Ordering::Less
}
impl PartialEq for FullInt {
+ #[must_use]
fn eq(&self, other: &Self) -> bool {
self.partial_cmp(other).expect("partial_cmp only returns Some(_)") == Ordering::Equal
}
}
impl PartialOrd for FullInt {
+ #[must_use]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(match (self, other) {
(&Self::S(s), &Self::S(o)) => s.cmp(&o),
}
}
impl Ord for FullInt {
+ #[must_use]
fn cmp(&self, other: &Self) -> Ordering {
self.partial_cmp(other)
.expect("partial_cmp for FullInt can never return None")
declare_clippy_lint! {
/// **What it does:** Checks for public `impl` or `fn` missing generalization
/// over different hashers and implicitly defaulting to the default hashing
- /// algorithm (SipHash).
+ /// algorithm (`SipHash`).
///
/// **Why is this bad?** `HashMap` or `HashSet` with custom hashers cannot be
/// used with them.
}
impl<'tcx> ImplicitHasherType<'tcx> {
- /// Checks that `ty` is a target type without a BuildHasher.
+ /// Checks that `ty` is a target type without a `BuildHasher`.
fn new<'a>(cx: &LateContext<'a, 'tcx>, hir_ty: &hir::Ty) -> Option<Self> {
if let TyKind::Path(QPath::Resolved(None, ref path)) = hir_ty.kind {
let params: Vec<_> = path