Replace cargo-cranky with workspace lints (#4413)

Replace `cargo-cranky` (which has served us well) with workspace lints
This commit is contained in:
Emil Ernerfeldt
2024-04-25 17:24:50 +02:00
committed by GitHub
parent cee790681d
commit 2f508d6a61
82 changed files with 348 additions and 289 deletions
+3
View File
@@ -13,6 +13,9 @@ categories = ["gui", "game-development"]
keywords = ["gui", "imgui", "immediate", "portable", "gamedev"]
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
[lints]
workspace = true
[package.metadata.docs.rs]
all-features = true
+2 -2
View File
@@ -1838,7 +1838,7 @@ impl Context {
let paint_widget_id = |id: Id, text: &str, color: Color32| {
if let Some(widget) =
self.write(|ctx| ctx.viewport().widgets_this_frame.get(id).cloned())
self.write(|ctx| ctx.viewport().widgets_this_frame.get(id).copied())
{
paint_widget(&widget, text, color);
}
@@ -2398,7 +2398,7 @@ impl Context {
/// See also [`Response::contains_pointer`].
pub fn rect_contains_pointer(&self, layer_id: LayerId, rect: Rect) -> bool {
let rect =
if let Some(transform) = self.memory(|m| m.layer_transforms.get(&layer_id).cloned()) {
if let Some(transform) = self.memory(|m| m.layer_transforms.get(&layer_id).copied()) {
transform * rect
} else {
rect
+6 -6
View File
@@ -35,25 +35,25 @@ pub enum Key {
/// `,`
Comma,
/// '\\'
/// `\`
Backslash,
/// '/'
/// `/`
Slash,
/// '|', a vertical bar
/// `|`, a vertical bar
Pipe,
/// `?`
Questionmark,
// '['
// `[`
OpenBracket,
// ']'
// `]`
CloseBracket,
/// '`', also known as "backquote" or "grave"
/// \`, also known as "backquote" or "grave"
Backtick,
/// `-`
+1 -1
View File
@@ -53,7 +53,7 @@ impl BytesLoader for DefaultBytesLoader {
#[cfg(feature = "log")]
log::trace!("forget {uri:?}");
let _ = self.cache.lock().remove(uri);
self.cache.lock().remove(uri);
}
fn forget_all(&self) {
+1 -1
View File
@@ -465,7 +465,7 @@ impl Response {
let mut pos = self.ctx.input(|i| i.pointer.hover_pos())?;
if let Some(transform) = self
.ctx
.memory(|m| m.layer_transforms.get(&self.layer_id).cloned())
.memory(|m| m.layer_transforms.get(&self.layer_id).copied())
{
pos = transform * pos;
}
+1 -1
View File
@@ -78,7 +78,7 @@ pub fn paint_cursor_end(painter: &Painter, visuals: &Visuals, cursor_rect: Rect)
/// Paint one end of the selection, e.g. the primary cursor, with blinking (if enabled).
pub fn paint_text_cursor(
ui: &mut Ui,
ui: &Ui,
painter: &Painter,
primary_cursor_rect: Rect,
time_since_last_edit: f64,
+3 -3
View File
@@ -702,7 +702,7 @@ impl<'t> TextEdit<'t> {
// Set IME output (in screen coords) when text is editable and visible
let transform = ui
.memory(|m| m.layer_transforms.get(&ui.layer_id()).cloned())
.memory(|m| m.layer_transforms.get(&ui.layer_id()).copied())
.unwrap_or_default();
ui.ctx().output_mut(|o| {
@@ -948,7 +948,7 @@ fn events(
key,
pressed: true,
..
} => check_for_mutating_key_press(os, &mut cursor_range, text, galley, modifiers, *key),
} => check_for_mutating_key_press(os, &cursor_range, text, galley, modifiers, *key),
Event::Ime(ime_event) => match ime_event {
ImeEvent::Enabled => {
@@ -1028,7 +1028,7 @@ fn events(
/// Returns `Some(new_cursor)` if we did mutate `text`.
fn check_for_mutating_key_press(
os: OperatingSystem,
cursor_range: &mut CursorRange,
cursor_range: &CursorRange,
text: &mut dyn TextBuffer,
galley: &Galley,
modifiers: &Modifiers,