refactor: say why the clippy allows are there, and drop the one that is not

Sixteen `#[allow(clippy::…)]` in the tree; thirteen carry a comment saying
why. These were the three that did not, and the reason turned out to differ
for each.

`spawn_once` takes eight arguments against a threshold of nine, so its
`too_many_arguments` allowed nothing at all -- removed. `render_ssh_row` does
trip it, at ten with `self`, and `LocalHost::new` really does hand back a
`SharedHost` rather than a `Self`; both now say so.

Removing all three first and reading what came back is what separated them,
and it needed two passes: clippy stops at the first crate that fails, so
tty7-core's error hid settings.rs's until it was fixed. A single clean run is
not evidence about anything downstream of the first failure.
This commit is contained in:
l0ng-ai
2026-08-15 22:54:11 +08:00
parent c24ef21472
commit a689ee2bb2
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -64,6 +64,10 @@ pub struct LocalHost {
}
impl LocalHost {
// Hands back the `SharedHost` rather than a bare `LocalHost` because that
// is the only shape anything uses one in: a host is reached through
// `Arc<dyn Host>`, and a caller given the struct would have to wrap it
// itself, every time, to do anything at all.
#[allow(clippy::new_ret_no_self)]
pub fn new() -> SharedHost {
Arc::new(LocalHost {
-1
View File
@@ -299,7 +299,6 @@ impl RemoteTerminal {
}
}
#[allow(clippy::too_many_arguments)]
fn spawn_once(
route: &PaneRoute,
size: TermSize,
+3
View File
@@ -3033,6 +3033,9 @@ impl Tty7App {
)
}
// Ten with `self`, against a threshold of nine. Every one is a distinct
// thing about the row being drawn, and a struct to carry them would be
// built inline at each of the call sites and read nowhere else.
#[allow(clippy::too_many_arguments)]
fn render_ssh_row(
&self,