Run cargo dev fmt

This commit is contained in:
JarredAllen 2020-08-04 17:53:29 -07:00
parent 25abd7ae76
commit 542740c2ec

View file

@ -43,30 +43,30 @@ declare_lint_pass!(StableSortPrimitive => [STABLE_SORT_PRIMITIVE]);
/// The three "kinds" of sorts /// The three "kinds" of sorts
enum SortingKind { enum SortingKind {
Vanilla, Vanilla,
// The other kinds of lint are currently commented out because they /* The other kinds of lint are currently commented out because they
// can map distinct values to equal ones. If the key function is * can map distinct values to equal ones. If the key function is
// provably one-to-one, or if the Cmp function conserves equality, * provably one-to-one, or if the Cmp function conserves equality,
// then they could be linted on, but I don't know if we can check * then they could be linted on, but I don't know if we can check
// for that. * for that. */
// ByKey, /* ByKey,
// ByCmp, * ByCmp, */
} }
impl SortingKind { impl SortingKind {
/// The name of the stable version of this kind of sort /// The name of the stable version of this kind of sort
fn stable_name(&self) -> &str { fn stable_name(&self) -> &str {
match self { match self {
SortingKind::Vanilla => "sort", SortingKind::Vanilla => "sort",
// SortingKind::ByKey => "sort_by_key", /* SortingKind::ByKey => "sort_by_key",
// SortingKind::ByCmp => "sort_by", * SortingKind::ByCmp => "sort_by", */
} }
} }
/// The name of the unstable version of this kind of sort /// The name of the unstable version of this kind of sort
fn unstable_name(&self) -> &str { fn unstable_name(&self) -> &str {
match self { match self {
SortingKind::Vanilla => "sort_unstable", SortingKind::Vanilla => "sort_unstable",
// SortingKind::ByKey => "sort_unstable_by_key", /* SortingKind::ByKey => "sort_unstable_by_key",
// SortingKind::ByCmp => "sort_unstable_by", * SortingKind::ByCmp => "sort_unstable_by", */
} }
} }
/// Takes the name of a function call and returns the kind of sort /// Takes the name of a function call and returns the kind of sort