mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 20:32:22 +03:00
Enable clippy::too_many_arguments
(#8734)
This PR enables the [`clippy::too_many_arguments`](https://rust-lang.github.io/rust-clippy/master/index.html#/too_many_arguments) rule. I opted to add `#[allow(clippy::too_many_arguments)]` on the individual violations, as reworking them to take fewer arguments is a more involved task. Release Notes: - N/A
This commit is contained in:
parent
eaf2fbb21b
commit
fc8e515fe8
@ -2835,6 +2835,7 @@ impl FocusableView for InlineAssistant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl InlineAssistant {
|
impl InlineAssistant {
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn new(
|
fn new(
|
||||||
id: usize,
|
id: usize,
|
||||||
measurements: Rc<Cell<BlockMeasurements>>,
|
measurements: Rc<Cell<BlockMeasurements>>,
|
||||||
|
@ -200,6 +200,7 @@ impl Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new channel message.
|
/// Creates a new channel message.
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub async fn create_channel_message(
|
pub async fn create_channel_message(
|
||||||
&self,
|
&self,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
|
@ -543,6 +543,7 @@ impl Server {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn handle_connection(
|
pub fn handle_connection(
|
||||||
self: &Arc<Self>,
|
self: &Arc<Self>,
|
||||||
connection: Connection,
|
connection: Connection,
|
||||||
|
@ -464,6 +464,7 @@ impl<T: RandomizedTest> TestPlan<T> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
async fn apply_server_operation(
|
async fn apply_server_operation(
|
||||||
plan: Arc<Mutex<Self>>,
|
plan: Arc<Mutex<Self>>,
|
||||||
deterministic: BackgroundExecutor,
|
deterministic: BackgroundExecutor,
|
||||||
|
@ -478,6 +478,7 @@ impl CollabTitlebarItem {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn render_collaborator(
|
fn render_collaborator(
|
||||||
&self,
|
&self,
|
||||||
user: &Arc<User>,
|
user: &Arc<User>,
|
||||||
|
@ -2992,6 +2992,7 @@ impl LineWithInvisibles {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn draw_invisibles(
|
fn draw_invisibles(
|
||||||
&self,
|
&self,
|
||||||
selection_ranges: &[Range<DisplayPoint>],
|
selection_ranges: &[Range<DisplayPoint>],
|
||||||
|
@ -1180,6 +1180,7 @@ fn parse_text(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn get_injections(
|
fn get_injections(
|
||||||
config: &InjectionConfig,
|
config: &InjectionConfig,
|
||||||
text: &BufferSnapshot,
|
text: &BufferSnapshot,
|
||||||
|
@ -261,6 +261,7 @@ impl LanguageServer {
|
|||||||
Ok(server)
|
Ok(server)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn new_internal<Stdin, Stdout, Stderr, F>(
|
fn new_internal<Stdin, Stdout, Stderr, F>(
|
||||||
server_id: LanguageServerId,
|
server_id: LanguageServerId,
|
||||||
stdin: Stdin,
|
stdin: Stdin,
|
||||||
|
@ -2909,6 +2909,7 @@ impl Project {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
async fn setup_and_insert_language_server(
|
async fn setup_and_insert_language_server(
|
||||||
this: WeakModel<Self>,
|
this: WeakModel<Self>,
|
||||||
worktree_path: &Path,
|
worktree_path: &Path,
|
||||||
@ -6182,6 +6183,7 @@ impl Project {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Pick paths that might potentially contain a match of a given search query.
|
/// Pick paths that might potentially contain a match of a given search query.
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
async fn background_search(
|
async fn background_search(
|
||||||
unnamed_buffers: Vec<Model<Buffer>>,
|
unnamed_buffers: Vec<Model<Buffer>>,
|
||||||
opened_buffers: HashMap<Arc<Path>, (Model<Buffer>, BufferSnapshot)>,
|
opened_buffers: HashMap<Arc<Path>, (Model<Buffer>, BufferSnapshot)>,
|
||||||
|
@ -3299,6 +3299,7 @@ enum BackgroundScannerPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl BackgroundScanner {
|
impl BackgroundScanner {
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn new(
|
fn new(
|
||||||
snapshot: LocalSnapshot,
|
snapshot: LocalSnapshot,
|
||||||
next_entry_id: Arc<AtomicUsize>,
|
next_entry_id: Arc<AtomicUsize>,
|
||||||
|
@ -124,6 +124,7 @@ impl RichText {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn render_markdown_mut(
|
pub fn render_markdown_mut(
|
||||||
block: &str,
|
block: &str,
|
||||||
mut mentions: &[Mention],
|
mut mentions: &[Mention],
|
||||||
|
@ -303,6 +303,7 @@ pub struct TerminalBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl TerminalBuilder {
|
impl TerminalBuilder {
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
working_directory: Option<PathBuf>,
|
working_directory: Option<PathBuf>,
|
||||||
task: Option<TaskState>,
|
task: Option<TaskState>,
|
||||||
|
@ -88,6 +88,7 @@ impl PaneGroup {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub(crate) fn render(
|
pub(crate) fn render(
|
||||||
&self,
|
&self,
|
||||||
project: &Model<Project>,
|
project: &Model<Project>,
|
||||||
@ -159,6 +160,7 @@ impl Member {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn render(
|
pub fn render(
|
||||||
&self,
|
&self,
|
||||||
project: &Model<Project>,
|
project: &Model<Project>,
|
||||||
@ -471,6 +473,7 @@ impl PaneAxis {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn render(
|
fn render(
|
||||||
&self,
|
&self,
|
||||||
project: &Model<Project>,
|
project: &Model<Project>,
|
||||||
@ -640,6 +643,7 @@ mod element {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn compute_resize(
|
fn compute_resize(
|
||||||
flexes: &Arc<Mutex<Vec<f32>>>,
|
flexes: &Arc<Mutex<Vec<f32>>>,
|
||||||
e: &MouseMoveEvent,
|
e: &MouseMoveEvent,
|
||||||
@ -728,6 +732,7 @@ mod element {
|
|||||||
cx.refresh();
|
cx.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn push_handle(
|
fn push_handle(
|
||||||
flexes: Arc<Mutex<Vec<f32>>>,
|
flexes: Arc<Mutex<Vec<f32>>>,
|
||||||
dragged_handle: Rc<RefCell<Option<usize>>>,
|
dragged_handle: Rc<RefCell<Option<usize>>>,
|
||||||
|
@ -123,7 +123,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
|
|||||||
"clippy::search_is_some",
|
"clippy::search_is_some",
|
||||||
"clippy::single_range_in_vec_init",
|
"clippy::single_range_in_vec_init",
|
||||||
"clippy::suspicious_to_owned",
|
"clippy::suspicious_to_owned",
|
||||||
"clippy::too_many_arguments",
|
|
||||||
"clippy::type_complexity",
|
"clippy::type_complexity",
|
||||||
"clippy::unit_arg",
|
"clippy::unit_arg",
|
||||||
"clippy::unnecessary_filter_map",
|
"clippy::unnecessary_filter_map",
|
||||||
|
Loading…
Reference in New Issue
Block a user