chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795)
While this lint is allow-by-default, it seems pretty useful to get rid of mutable borrows when they're not needed. Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
59f0f4ac42
commit
03c84466c2
36 changed files with 158 additions and 204 deletions
|
@ -706,11 +706,7 @@ pub struct Bounds<T: Clone + Default + Debug> {
|
|||
|
||||
impl Bounds<Pixels> {
|
||||
/// Generate a centered bounds for the given display or primary display if none is provided
|
||||
pub fn centered(
|
||||
display_id: Option<DisplayId>,
|
||||
size: Size<Pixels>,
|
||||
cx: &mut AppContext,
|
||||
) -> Self {
|
||||
pub fn centered(display_id: Option<DisplayId>, size: Size<Pixels>, cx: &AppContext) -> Self {
|
||||
let display = display_id
|
||||
.and_then(|id| cx.find_display(id))
|
||||
.or_else(|| cx.primary_display());
|
||||
|
@ -730,7 +726,7 @@ impl Bounds<Pixels> {
|
|||
}
|
||||
|
||||
/// Generate maximized bounds for the given display or primary display if none is provided
|
||||
pub fn maximized(display_id: Option<DisplayId>, cx: &mut AppContext) -> Self {
|
||||
pub fn maximized(display_id: Option<DisplayId>, cx: &AppContext) -> Self {
|
||||
let display = display_id
|
||||
.and_then(|id| cx.find_display(id))
|
||||
.or_else(|| cx.primary_display());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue