clippy: println_empty_string & non_minimal_cfg (#36614)
- **clippy: Fix println-empty-string** - **clippy: non-minimal-cfg** Related to #36577 Release Notes: - N/A
This commit is contained in:
parent
b6722ca3c8
commit
74ce543d8b
5 changed files with 3 additions and 16 deletions
|
@ -900,6 +900,7 @@ needless_parens_on_range_literals = "warn"
|
||||||
needless_pub_self = "warn"
|
needless_pub_self = "warn"
|
||||||
needless_return = "warn"
|
needless_return = "warn"
|
||||||
needless_return_with_question_mark = "warn"
|
needless_return_with_question_mark = "warn"
|
||||||
|
non_minimal_cfg = "warn"
|
||||||
ok_expect = "warn"
|
ok_expect = "warn"
|
||||||
owned_cow = "warn"
|
owned_cow = "warn"
|
||||||
print_literal = "warn"
|
print_literal = "warn"
|
||||||
|
|
|
@ -161,7 +161,7 @@ impl UserMessage {
|
||||||
}
|
}
|
||||||
UserMessageContent::Mention { uri, content } => {
|
UserMessageContent::Mention { uri, content } => {
|
||||||
if !content.is_empty() {
|
if !content.is_empty() {
|
||||||
let _ = write!(&mut markdown, "{}\n\n{}\n", uri.as_link(), content);
|
let _ = writeln!(&mut markdown, "{}\n\n{}", uri.as_link(), content);
|
||||||
} else {
|
} else {
|
||||||
let _ = writeln!(&mut markdown, "{}", uri.as_link());
|
let _ = writeln!(&mut markdown, "{}", uri.as_link());
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,6 @@ impl TaffyLayoutEngine {
|
||||||
// for (a, b) in self.get_edges(id)? {
|
// for (a, b) in self.get_edges(id)? {
|
||||||
// println!("N{} --> N{}", u64::from(a), u64::from(b));
|
// println!("N{} --> N{}", u64::from(a), u64::from(b));
|
||||||
// }
|
// }
|
||||||
// println!("");
|
|
||||||
//
|
//
|
||||||
|
|
||||||
if !self.computed_layouts.insert(id) {
|
if !self.computed_layouts.insert(id) {
|
||||||
|
|
|
@ -34,13 +34,6 @@ trait Transform: Clone {
|
||||||
|
|
||||||
/// Adds one to the value
|
/// Adds one to the value
|
||||||
fn add_one(self) -> Self;
|
fn add_one(self) -> Self;
|
||||||
|
|
||||||
/// cfg attributes are respected
|
|
||||||
#[cfg(all())]
|
|
||||||
fn cfg_included(self) -> Self;
|
|
||||||
|
|
||||||
#[cfg(any())]
|
|
||||||
fn cfg_omitted(self) -> Self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
@ -70,10 +63,6 @@ impl Transform for Number {
|
||||||
fn add_one(self) -> Self {
|
fn add_one(self) -> Self {
|
||||||
Number(self.0 + 1)
|
Number(self.0 + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cfg_included(self) -> Self {
|
|
||||||
Number(self.0)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -83,14 +72,13 @@ fn test_derive_inspector_reflection() {
|
||||||
// Get all methods that match the pattern fn(self) -> Self or fn(mut self) -> Self
|
// Get all methods that match the pattern fn(self) -> Self or fn(mut self) -> Self
|
||||||
let methods = methods::<Number>();
|
let methods = methods::<Number>();
|
||||||
|
|
||||||
assert_eq!(methods.len(), 6);
|
assert_eq!(methods.len(), 5);
|
||||||
let method_names: Vec<_> = methods.iter().map(|m| m.name).collect();
|
let method_names: Vec<_> = methods.iter().map(|m| m.name).collect();
|
||||||
assert!(method_names.contains(&"double"));
|
assert!(method_names.contains(&"double"));
|
||||||
assert!(method_names.contains(&"triple"));
|
assert!(method_names.contains(&"triple"));
|
||||||
assert!(method_names.contains(&"increment"));
|
assert!(method_names.contains(&"increment"));
|
||||||
assert!(method_names.contains(&"quadruple"));
|
assert!(method_names.contains(&"quadruple"));
|
||||||
assert!(method_names.contains(&"add_one"));
|
assert!(method_names.contains(&"add_one"));
|
||||||
assert!(method_names.contains(&"cfg_included"));
|
|
||||||
|
|
||||||
// Invoke methods by name
|
// Invoke methods by name
|
||||||
let num = Number(5);
|
let num = Number(5);
|
||||||
|
|
|
@ -307,7 +307,6 @@ impl TabSwitcherDelegate {
|
||||||
(Reverse(history.get(&item.item.item_id())), item.item_index)
|
(Reverse(history.get(&item.item.item_id())), item.item_index)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
eprintln!();
|
|
||||||
all_items
|
all_items
|
||||||
.sort_by_key(|tab| (Reverse(history.get(&tab.item.item_id())), tab.item_index));
|
.sort_by_key(|tab| (Reverse(history.get(&tab.item.item_id())), tab.item_index));
|
||||||
all_items
|
all_items
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue