Only build, but don't run tests in MSRV CI (#2558)

* Only build, but don't run tests in MSRV CI

Since the MSRV of development dependencies can easily be bumped without it affecting the MSRV of the published version of `winit`

* Run clippy on stable Rust instead of MSRV Rust

clippy inspects the `rust-version` field, and only suggests changes that conform to that.
This commit is contained in:
Mads Marquart 2022-11-23 13:07:58 +01:00 committed by GitHub
parent bdcbd7d1f9
commit ce6c6e8c95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 72 additions and 58 deletions

View file

@ -15,6 +15,8 @@ use std::{
pub struct Shared<T: 'static>(Rc<Execution<T>>);
pub(super) type EventHandler<T> = dyn FnMut(Event<'_, T>, &mut ControlFlow);
impl<T> Clone for Shared<T> {
fn clone(&self) -> Self {
Shared(self.0.clone())
@ -54,11 +56,11 @@ impl<T: 'static> RunnerEnum<T> {
struct Runner<T: 'static> {
state: State,
event_handler: Box<dyn FnMut(Event<'_, T>, &mut ControlFlow)>,
event_handler: Box<EventHandler<T>>,
}
impl<T: 'static> Runner<T> {
pub fn new(event_handler: Box<dyn FnMut(Event<'_, T>, &mut ControlFlow)>) -> Self {
pub fn new(event_handler: Box<EventHandler<T>>) -> Self {
Runner {
state: State::Init,
event_handler,
@ -123,7 +125,7 @@ impl<T: 'static> Shared<T> {
// Set the event callback to use for the event loop runner
// This the event callback is a fairly thin layer over the user-provided callback that closes
// over a RootEventLoopWindowTarget reference
pub fn set_listener(&self, event_handler: Box<dyn FnMut(Event<'_, T>, &mut ControlFlow)>) {
pub fn set_listener(&self, event_handler: Box<EventHandler<T>>) {
{
let mut runner = self.0.runner.borrow_mut();
assert!(matches!(*runner, RunnerEnum::Pending));

View file

@ -14,7 +14,6 @@ use crate::event::{
DeviceEvent, DeviceId as RootDeviceId, ElementState, Event, KeyboardInput, TouchPhase,
WindowEvent,
};
use crate::event_loop::ControlFlow;
use crate::window::{Theme, WindowId as RootWindowId};
pub struct EventLoopWindowTarget<T: 'static> {
@ -40,7 +39,7 @@ impl<T> EventLoopWindowTarget<T> {
EventLoopProxy::new(self.runner.clone())
}
pub fn run(&self, event_handler: Box<dyn FnMut(Event<'_, T>, &mut ControlFlow)>) {
pub fn run(&self, event_handler: Box<runner::EventHandler<T>>) {
self.runner.set_listener(event_handler);
let runner = self.runner.clone();
self.runner.set_on_scale_change(move |arg| {

View file

@ -249,7 +249,7 @@ impl Window {
} else {
self.canvas
.borrow()
.set_attribute("cursor", *self.previous_pointer.borrow());
.set_attribute("cursor", &self.previous_pointer.borrow());
}
}