Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return** - **Fix single worktree violation** - **And the rest** Release Notes: - N/A
This commit is contained in:
parent
df9c2aefb1
commit
05fc0c432c
239 changed files with 854 additions and 1015 deletions
|
@ -102,7 +102,7 @@ impl ProfileProvider for Entity<agent2::Thread> {
|
|||
fn profiles_supported(&self, cx: &App) -> bool {
|
||||
self.read(cx)
|
||||
.model()
|
||||
.map_or(false, |model| model.supports_tools())
|
||||
.is_some_and(|model| model.supports_tools())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2843,7 +2843,7 @@ impl AcpThreadView {
|
|||
|
||||
if thread
|
||||
.model()
|
||||
.map_or(true, |model| !model.supports_burn_mode())
|
||||
.is_none_or(|model| !model.supports_burn_mode())
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
@ -2875,9 +2875,9 @@ impl AcpThreadView {
|
|||
|
||||
fn render_send_button(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
let is_editor_empty = self.message_editor.read(cx).is_empty(cx);
|
||||
let is_generating = self.thread().map_or(false, |thread| {
|
||||
thread.read(cx).status() != ThreadStatus::Idle
|
||||
});
|
||||
let is_generating = self
|
||||
.thread()
|
||||
.is_some_and(|thread| thread.read(cx).status() != ThreadStatus::Idle);
|
||||
|
||||
if is_generating && is_editor_empty {
|
||||
IconButton::new("stop-generation", IconName::Stop)
|
||||
|
@ -3455,18 +3455,16 @@ impl AcpThreadView {
|
|||
} else {
|
||||
format!("Retrying. Next attempt in {next_attempt_in_secs} seconds.")
|
||||
}
|
||||
} else if next_attempt_in_secs == 1 {
|
||||
format!(
|
||||
"Retrying. Next attempt in 1 second (Attempt {} of {}).",
|
||||
state.attempt, state.max_attempts,
|
||||
)
|
||||
} else {
|
||||
if next_attempt_in_secs == 1 {
|
||||
format!(
|
||||
"Retrying. Next attempt in 1 second (Attempt {} of {}).",
|
||||
state.attempt, state.max_attempts,
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"Retrying. Next attempt in {next_attempt_in_secs} seconds (Attempt {} of {}).",
|
||||
state.attempt, state.max_attempts,
|
||||
)
|
||||
}
|
||||
format!(
|
||||
"Retrying. Next attempt in {next_attempt_in_secs} seconds (Attempt {} of {}).",
|
||||
state.attempt, state.max_attempts,
|
||||
)
|
||||
};
|
||||
|
||||
Some(
|
||||
|
@ -3552,7 +3550,7 @@ impl AcpThreadView {
|
|||
let supports_burn_mode = thread
|
||||
.read(cx)
|
||||
.model()
|
||||
.map_or(false, |model| model.supports_burn_mode());
|
||||
.is_some_and(|model| model.supports_burn_mode());
|
||||
|
||||
let focus_handle = self.focus_handle(cx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue