Fix most of the warnings

This commit is contained in:
Antonio Scandurra 2023-04-14 10:51:53 +02:00
parent 5666e8301e
commit 7394bf1cdc
13 changed files with 44 additions and 61 deletions

View file

@ -12,20 +12,17 @@ pub struct KeystrokeLabel {
action: Box<dyn Action>,
container_style: ContainerStyle,
text_style: TextStyle,
window_id: usize,
view_id: usize,
}
impl KeystrokeLabel {
pub fn new(
window_id: usize,
view_id: usize,
action: Box<dyn Action>,
container_style: ContainerStyle,
text_style: TextStyle,
) -> Self {
Self {
window_id,
view_id,
action,
container_style,

View file

@ -280,7 +280,7 @@ mod tests {
#[crate::test(self)]
fn test_soft_wrapping_with_carriage_returns(cx: &mut AppContext) {
let (window_id, root_view) = cx.add_window(Default::default(), |_| TestView);
let (_, root_view) = cx.add_window(Default::default(), |_| TestView);
fonts::with_font_cache(cx.font_cache().clone(), || {
root_view.update(cx, |view, cx| {
let mut text = Text::new("Hello\r\n", Default::default()).with_soft_wrap(true);

View file

@ -65,7 +65,6 @@ impl<V: View> Tooltip<V> {
let state = state_handle.read(cx).clone();
let tooltip = if state.visible.get() {
let mut collapsed_tooltip = Self::render_tooltip(
cx.window_id,
focused_view_id,
text.clone(),
style.clone(),
@ -75,7 +74,7 @@ impl<V: View> Tooltip<V> {
.boxed();
Some(
Overlay::new(
Self::render_tooltip(cx.window_id, focused_view_id, text, style, action, false)
Self::render_tooltip(focused_view_id, text, style, action, false)
.constrained()
.dynamically(move |constraint, view, cx| {
SizeConstraint::strict_along(
@ -128,7 +127,6 @@ impl<V: View> Tooltip<V> {
}
pub fn render_tooltip(
window_id: usize,
focused_view_id: Option<usize>,
text: String,
style: TooltipStyle,
@ -148,7 +146,6 @@ impl<V: View> Tooltip<V> {
})
.with_children(action.and_then(|action| {
let keystroke_label = KeystrokeLabel::new(
window_id,
focused_view_id?,
action,
style.keystroke.container,