Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- "main"
pull_request:
types: [opened, synchronize]
types: [ opened, synchronize ]

name: Rust

Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: 1.81.0
toolchain: 1.84.0
override: true

- name: Install packages (Linux)
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.81.0
toolchain: 1.84.0
target: wasm32-unknown-unknown
override: true
components: clippy
Expand All @@ -95,7 +95,7 @@ jobs:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v2
with:
rust-version: "1.81.0"
rust-version: "1.84.0"
log-level: warn
command: check

Expand All @@ -109,7 +109,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.81.0
toolchain: 1.84.0
target: wasm32-unknown-unknown
override: true
- name: Download and install Trunk binary
Expand All @@ -131,7 +131,7 @@ jobs:
lfs: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.81.0
toolchain: 1.84.0

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand Down
16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = ["egui_plot", "demo", "examples/*"]
[workspace.package]
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.81"
rust-version = "1.84"
version = "0.32.1"


Expand Down Expand Up @@ -93,6 +93,7 @@ disallowed_methods = "warn" # See clippy.toml
disallowed_names = "warn" # See clippy.toml
disallowed_script_idents = "warn" # See clippy.toml
disallowed_types = "warn" # See clippy.toml
doc_include_without_cfg = "warn"
doc_link_with_quotes = "warn"
doc_markdown = "warn"
empty_enum = "warn"
Expand Down Expand Up @@ -136,18 +137,19 @@ let_underscore_must_use = "warn"
let_underscore_untyped = "warn"
let_unit_value = "warn"
linkedlist = "warn"
literal_string_with_formatting_args = "warn"
lossy_float_literal = "warn"
macro_use_imports = "warn"
manual_assert = "warn"
manual_clamp = "warn"
manual_instant_elapsed = "warn"
manual_is_power_of_two = "warn"
manual_is_variant_and = "warn"
manual_let_else = "warn"
manual_ok_or = "warn"
manual_string_new = "warn"
map_err_ignore = "warn"
map_flatten = "warn"
map_unwrap_or = "warn"
match_bool = "warn"
match_on_vec_items = "warn"
match_same_arms = "warn"
Expand All @@ -168,10 +170,12 @@ needless_for_each = "warn"
needless_pass_by_ref_mut = "warn"
needless_pass_by_value = "warn"
negative_feature_names = "warn"
non_zero_suggestions = "warn"
nonstandard_macro_braces = "warn"
option_as_ref_cloned = "warn"
option_option = "warn"
path_buf_push_overwrite = "warn"
pathbuf_init_then_push = "warn"
ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
pub_underscore_fields = "warn"
Expand All @@ -184,8 +188,10 @@ ref_option_ref = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
set_contains_or_insert = "warn"
should_panic_without_expect = "warn"
significant_drop_tightening = "warn"
single_char_pattern = "warn"
single_match_else = "warn"
str_split_at_newline = "warn"
str_to_string = "warn"
Expand All @@ -197,6 +203,7 @@ string_to_string = "warn"
suspicious_command_arg_space = "warn"
suspicious_xor_used_as_pow = "warn"
todo = "warn"
too_long_first_doc_paragraph = "warn"
too_many_lines = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
Expand All @@ -207,20 +214,25 @@ unimplemented = "warn"
uninhabited_references = "warn"
uninlined_format_args = "warn"
unnecessary_box_returns = "warn"
unnecessary_literal_bound = "warn"
unnecessary_safety_doc = "warn"
unnecessary_struct_initialization = "warn"
unnecessary_wraps = "warn"
unnested_or_patterns = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
unused_self = "warn"
unused_trait_names = "warn"
unwrap_used = "warn"
use_self = "warn"
useless_transmute = "warn"
verbose_file_reads = "warn"
wildcard_dependencies = "warn"
wildcard_imports = "warn"
zero_sized_map_values = "warn"
# Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
#self_named_module_files = "warn"

manual_range_contains = "allow" # this one is just worse imho
map_unwrap_or = "allow" # so is this one
ref_patterns = "allow" # It's nice to avoid ref pattern, but there are some situations that are hard (impossible?) to express without.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# -----------------------------------------------------------------------------
# Section identical to scripts/clippy_wasm/clippy.toml:

msrv = "1.81"
msrv = "1.84"

allow-unwrap-in-tests = true

Expand Down
2 changes: 1 addition & 1 deletion demo/src/plot_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::f64::consts::TAU;
use std::ops::RangeInclusive;

use egui::{
remap, vec2, Color32, ComboBox, NumExt, Pos2, Response, ScrollArea, Stroke, TextWrapMode,
remap, vec2, Color32, ComboBox, NumExt as _, Pos2, Response, ScrollArea, Stroke, TextWrapMode,
Vec2b, WidgetInfo, WidgetType,
};

Expand Down
2 changes: 1 addition & 1 deletion demo/tests/plot.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use demo::TemplateApp;
use egui::accesskit::Role;
use egui::ThemePreference;
use egui_kittest::kittest::Queryable;
use egui_kittest::kittest::Queryable as _;

#[test]
fn test_demos() {
Expand Down
2 changes: 1 addition & 1 deletion egui_plot/src/items/bar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use egui::emath::NumExt;
use egui::emath::NumExt as _;
use egui::epaint::{Color32, CornerRadius, RectShape, Shape, Stroke};

use super::{add_rulers_and_text, highlighted_color, Orientation, PlotConfig, RectElement};
Expand Down
6 changes: 4 additions & 2 deletions egui_plot/src/items/box_elem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ impl BoxSpread {
}
}

/// A box in a [`BoxPlot`] diagram. This is a low level graphical element; it will not compute quartiles and whiskers,
/// letting one use their preferred formula. Use [`Points`][`super::Points`] to draw the outliers.
/// A box in a [`BoxPlot`] diagram.
///
/// This is a low-level graphical element; it will not compute quartiles and whiskers, letting one
/// use their preferred formula. Use [`Points`][`super::Points`] to draw the outliers.
#[derive(Clone, Debug, PartialEq)]
pub struct BoxElem {
/// Name of plot element in the diagram (annotated by default formatter).
Expand Down
8 changes: 4 additions & 4 deletions egui_plot/src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ fn y_intersection(p1: &Pos2, p2: &Pos2, y: f32) -> Option<f32> {
.then_some(((y * (p1.x - p2.x)) - (p1.x * p2.y - p1.y * p2.x)) / (p1.y - p2.y))
}

impl<'a> PlotItem for Line<'a> {
impl PlotItem for Line<'_> {
fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>) {
let Self {
base,
Expand Down Expand Up @@ -592,7 +592,7 @@ impl<'a> Polygon<'a> {
builder_methods_for_base!();
}

impl<'a> PlotItem for Polygon<'a> {
impl PlotItem for Polygon<'_> {
fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>) {
let Self {
base,
Expand Down Expand Up @@ -810,7 +810,7 @@ impl<'a> Points<'a> {
builder_methods_for_base!();
}

impl<'a> PlotItem for Points<'a> {
impl PlotItem for Points<'_> {
#[allow(clippy::too_many_lines)] // TODO(emilk): shorten this function
fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>) {
let sqrt_3 = 3_f32.sqrt();
Expand Down Expand Up @@ -1006,7 +1006,7 @@ impl<'a> Arrows<'a> {
builder_methods_for_base!();
}

impl<'a> PlotItem for Arrows<'a> {
impl PlotItem for Arrows<'_> {
fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>) {
let Self {
origins,
Expand Down
8 changes: 4 additions & 4 deletions egui_plot/src/items/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@ pub enum PlotPoints<'a> {
Borrowed(&'a [PlotPoint]),
}

impl<'a> Default for PlotPoints<'a> {
impl Default for PlotPoints<'_> {
fn default() -> Self {
Self::Owned(Vec::new())
}
}

impl<'a> From<[f64; 2]> for PlotPoints<'a> {
impl From<[f64; 2]> for PlotPoints<'_> {
fn from(coordinate: [f64; 2]) -> Self {
Self::new(vec![coordinate])
}
}

impl<'a> From<Vec<[f64; 2]>> for PlotPoints<'a> {
impl From<Vec<[f64; 2]>> for PlotPoints<'_> {
#[inline]
fn from(coordinates: Vec<[f64; 2]>) -> Self {
Self::new(coordinates)
Expand All @@ -188,7 +188,7 @@ impl<'a> From<&'a [PlotPoint]> for PlotPoints<'a> {
}
}

impl<'a> FromIterator<[f64; 2]> for PlotPoints<'a> {
impl FromIterator<[f64; 2]> for PlotPoints<'_> {
fn from_iter<T: IntoIterator<Item = [f64; 2]>>(iter: T) -> Self {
Self::Owned(iter.into_iter().map(|point| point.into()).collect())
}
Expand Down
8 changes: 4 additions & 4 deletions egui_plot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::{cmp::Ordering, ops::RangeInclusive, sync::Arc};

use ahash::HashMap;
use egui::{
epaint, remap_clamp, vec2, Align2, Color32, CursorIcon, Id, Layout, NumExt, PointerButton,
epaint, remap_clamp, vec2, Align2, Color32, CursorIcon, Id, Layout, NumExt as _, PointerButton,
Pos2, Rangef, Rect, Response, Sense, Shape, Stroke, TextStyle, Ui, Vec2, Vec2b, WidgetText,
};
use emath::Float as _;
Expand Down Expand Up @@ -1225,8 +1225,8 @@ impl<'a> Plot<'a> {
show_grid,
grid_spacing,
transform: mem.transform,
draw_cursor_x: linked_cursors.as_ref().map_or(false, |group| group.1.x),
draw_cursor_y: linked_cursors.as_ref().map_or(false, |group| group.1.y),
draw_cursor_x: linked_cursors.as_ref().is_some_and(|group| group.1.x),
draw_cursor_y: linked_cursors.as_ref().is_some_and(|group| group.1.y),
draw_cursors,
cursor_color,
grid_spacers,
Expand Down Expand Up @@ -1528,7 +1528,7 @@ struct PreparedPlot<'a> {
clamp_grid: bool,
}

impl<'a> PreparedPlot<'a> {
impl PreparedPlot<'_> {
fn ui(self, ui: &mut Ui, response: &Response) -> (Vec<Cursor>, Option<Id>) {
let mut axes_shapes = Vec::new();

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "1.81" # Avoid specifying a patch version here; see https://github.com/emilk/eframe_template/issues/145
channel = "1.84" # Avoid specifying a patch version here; see https://github.com/emilk/eframe_template/issues/145
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -x
# Checks all tests, lints etc.
# Basically does what the CI does.

cargo +1.81 install --quiet typos-cli
cargo +1.84 install --quiet typos-cli

export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454
Expand Down
2 changes: 1 addition & 1 deletion scripts/clippy_wasm/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# -----------------------------------------------------------------------------
# Section identical to the main clippy.toml:

msrv = "1.81"
msrv = "1.84"

allow-unwrap-in-tests = true

Expand Down
Loading