mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
c-c-c-clippy
This commit is contained in:
parent
bee8bdcfc0
commit
d5c50d0d04
2 changed files with 7 additions and 10 deletions
|
@ -433,7 +433,7 @@ fn add_single_tag_struct(
|
|||
|
||||
add_decl(
|
||||
impls,
|
||||
opt_impl.clone(),
|
||||
opt_impl,
|
||||
target_info,
|
||||
format!(
|
||||
r#"/// Other `as` methods return a payload, but since the {tag_name} tag
|
||||
|
@ -664,13 +664,12 @@ pub struct {name} {{
|
|||
impls,
|
||||
opt_impl.clone(),
|
||||
target_info,
|
||||
format!(
|
||||
r#"/// This is a single-tag union, so it has no alternatives
|
||||
r#"/// This is a single-tag union, so it has no alternatives
|
||||
/// to discriminate between. This method is only included for completeness.
|
||||
pub fn discriminant(&self) -> () {{
|
||||
pub fn discriminant(&self) -> () {
|
||||
()
|
||||
}}"#
|
||||
),
|
||||
}"#
|
||||
.to_string(),
|
||||
);
|
||||
} else {
|
||||
add_decl(
|
||||
|
@ -1246,7 +1245,6 @@ pub struct {name} {{
|
|||
}}
|
||||
"#
|
||||
)
|
||||
.to_string()
|
||||
} else {
|
||||
let mut buf = r#"fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
|
||||
match self.discriminant().partial_cmp(&other.discriminant()) {
|
||||
|
@ -1302,7 +1300,6 @@ pub struct {name} {{
|
|||
}}
|
||||
"#
|
||||
)
|
||||
.to_string()
|
||||
} else {
|
||||
let mut buf = r#"fn cmp(&self, other: &Self) -> core::cmp::Ordering {
|
||||
match self.discriminant().cmp(&other.discriminant()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue