Update MSRV to Rust 1.72 (#3595)

Required to update to puffin 0.18
This commit is contained in:
Emil Ernerfeldt 2023-11-21 17:26:35 +01:00 committed by GitHub
parent 7abf8afd16
commit bfadb90d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 206 additions and 190 deletions

View File

@ -43,7 +43,7 @@ jobs:
with: with:
profile: minimal profile: minimal
target: wasm32-unknown-unknown target: wasm32-unknown-unknown
toolchain: 1.70.0 toolchain: 1.72.0
override: true override: true
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2

View File

@ -19,7 +19,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: 1.70.0 toolchain: 1.72.0
- name: Install packages (Linux) - name: Install packages (Linux)
if: runner.os == 'Linux' if: runner.os == 'Linux'
@ -93,7 +93,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: 1.70.0 toolchain: 1.72.0
targets: wasm32-unknown-unknown targets: wasm32-unknown-unknown
- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev - run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev
@ -151,7 +151,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1 - uses: EmbarkStudios/cargo-deny-action@v1
with: with:
rust-version: "1.70.0" rust-version: "1.72.0"
log-level: error log-level: error
command: check command: check
arguments: --target ${{ matrix.target }} arguments: --target ${{ matrix.target }}
@ -166,7 +166,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: 1.70.0 toolchain: 1.72.0
targets: aarch64-linux-android targets: aarch64-linux-android
- name: Set up cargo cache - name: Set up cargo cache
@ -184,7 +184,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: 1.70.0 toolchain: 1.72.0
- name: Set up cargo cache - name: Set up cargo cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2

View File

@ -40,6 +40,8 @@ puffin = "0.17"
raw-window-handle = "0.5.0" raw-window-handle = "0.5.0"
thiserror = "1.0.37" thiserror = "1.0.37"
wgpu = "0.18.0" # Make the renderer `Sync` even on wasm32, because it makes the code simpler:
wgpu = { version = "0.18.0", features = ["fragile-send-sync-non-atomic-wasm"] }
# Use this to build wgpu with WebGL support on the Web *instead* of using WebGPU. # Use this to build wgpu with WebGL support on the Web *instead* of using WebGPU.
#wgpu = { version = "0.18.0", features = ["webgl"] } #wgpu = { version = "0.18.0", features = ["webgl"] }

View File

@ -55,6 +55,7 @@ warn = [
"clippy::large_digit_groups", "clippy::large_digit_groups",
"clippy::large_include_file", "clippy::large_include_file",
"clippy::large_stack_arrays", "clippy::large_stack_arrays",
"clippy::large_stack_frames",
"clippy::large_types_passed_by_value", "clippy::large_types_passed_by_value",
"clippy::let_unit_value", "clippy::let_unit_value",
"clippy::linkedlist", "clippy::linkedlist",
@ -90,7 +91,9 @@ warn = [
"clippy::option_option", "clippy::option_option",
"clippy::path_buf_push_overwrite", "clippy::path_buf_push_overwrite",
"clippy::ptr_as_ptr", "clippy::ptr_as_ptr",
"clippy::ptr_cast_constness",
"clippy::rc_mutex", "clippy::rc_mutex",
"clippy::redundant_type_annotations",
"clippy::ref_option_ref", "clippy::ref_option_ref",
"clippy::rest_pat_in_fully_bound_structs", "clippy::rest_pat_in_fully_bound_structs",
"clippy::same_functions_in_if_condition", "clippy::same_functions_in_if_condition",
@ -106,6 +109,7 @@ warn = [
"clippy::todo", "clippy::todo",
"clippy::trailing_empty_array", "clippy::trailing_empty_array",
"clippy::trait_duplication_in_bounds", "clippy::trait_duplication_in_bounds",
"clippy::tuple_array_conversions",
"clippy::unchecked_duration_subtraction", "clippy::unchecked_duration_subtraction",
"clippy::unimplemented", "clippy::unimplemented",
"clippy::uninlined_format_args", "clippy::uninlined_format_args",
@ -129,6 +133,7 @@ warn = [
"rustdoc::missing_crate_level_docs", "rustdoc::missing_crate_level_docs",
"semicolon_in_expressions_from_macros", "semicolon_in_expressions_from_macros",
"trivial_numeric_casts", "trivial_numeric_casts",
"unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
"unused_extern_crates", "unused_extern_crates",
"unused_import_braces", "unused_import_braces",
"unused_lifetimes", "unused_lifetimes",
@ -136,16 +141,16 @@ warn = [
allow = [ allow = [
"clippy::manual_range_contains", # this one is just worse imho "clippy::manual_range_contains", # this one is just worse imho
"clippy::significant_drop_tightening", # A lot of false positives
"clippy::significant_drop_tightening", # False positives
# TODO(emilk): enable more of these lints: # TODO(emilk): enable more of these lints:
"clippy::cloned_instead_of_copied",
"clippy::let_underscore_untyped", "clippy::let_underscore_untyped",
"clippy::missing_assert_message", "clippy::missing_assert_message",
"clippy::missing_errors_doc",
"clippy::undocumented_unsafe_blocks", "clippy::undocumented_unsafe_blocks",
"clippy::unwrap_used", "clippy::unwrap_used",
"clippy::wildcard_imports", "clippy::wildcard_imports", # we do this a lot
"trivial_casts", "trivial_casts",
"unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
"unused_qualifications", "unused_qualifications",
] ]

View File

@ -3,7 +3,7 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Section identical to scripts/clippy_wasm/clippy.toml: # Section identical to scripts/clippy_wasm/clippy.toml:
msrv = "1.70" msrv = "1.72"
allow-unwrap-in-tests = true allow-unwrap-in-tests = true

View File

@ -7,7 +7,7 @@ authors = [
] ]
description = "Color structs and color conversion utilities" description = "Color structs and color conversion utilities"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui" homepage = "https://github.com/emilk/egui"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "egui framework - write GUI apps that compiles to web and/or natively" description = "egui framework - write GUI apps that compiles to web and/or natively"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/eframe" homepage = "https://github.com/emilk/egui/tree/master/crates/eframe"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -853,7 +853,7 @@ impl GlutinWindowContext {
.with_context_api(glutin::context::ContextApi::Gles(None)) .with_context_api(glutin::context::ContextApi::Gles(None))
.build(raw_window_handle); .build(raw_window_handle);
let gl_context_result = { let gl_context_result = unsafe {
crate::profile_scope!("create_context"); crate::profile_scope!("create_context");
gl_config gl_config
.display() .display()
@ -867,10 +867,12 @@ impl GlutinWindowContext {
log::debug!( log::debug!(
"Retrying with fallback context attributes: {fallback_context_attributes:?}" "Retrying with fallback context attributes: {fallback_context_attributes:?}"
); );
unsafe {
gl_config gl_config
.display() .display()
.create_context(&gl_config, &fallback_context_attributes)? .create_context(&gl_config, &fallback_context_attributes)?
} }
}
}; };
let not_current_gl_context = Some(gl_context); let not_current_gl_context = Some(gl_context);

View File

@ -8,7 +8,7 @@ authors = [
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>", "Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
] ]
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-wgpu" homepage = "https://github.com/emilk/egui/tree/master/crates/egui-wgpu"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -7,11 +7,7 @@ use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex
use wgpu; use wgpu;
use wgpu::util::DeviceExt as _; use wgpu::util::DeviceExt as _;
// Only implements Send + Sync on wasm32 in order to allow storing wgpu resources on the type map.
#[cfg(not(target_arch = "wasm32"))]
pub type CallbackResources = type_map::concurrent::TypeMap; pub type CallbackResources = type_map::concurrent::TypeMap;
#[cfg(target_arch = "wasm32")]
pub type CallbackResources = type_map::TypeMap;
pub struct Callback(Box<dyn CallbackTrait>); pub struct Callback(Box<dyn CallbackTrait>);
@ -987,9 +983,6 @@ impl ScissorRect {
} }
} }
// Wgpu objects contain references to the JS heap on the web, therefore they are not Send/Sync.
// It follows that egui_wgpu::Renderer can not be Send/Sync either when building with wasm.
#[cfg(not(target_arch = "wasm32"))]
#[test] #[test]
fn renderer_impl_send_sync() { fn renderer_impl_send_sync() {
fn assert_send_sync<T: Send + Sync>() {} fn assert_send_sync<T: Send + Sync>() {}

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Bindings for using egui with winit" description = "Bindings for using egui with winit"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-winit" homepage = "https://github.com/emilk/egui/tree/master/crates/egui-winit"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "An easy-to-use immediate mode GUI that runs on both web and native" description = "An easy-to-use immediate mode GUI that runs on both web and native"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui" homepage = "https://github.com/emilk/egui"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "../../README.md" readme = "../../README.md"

View File

@ -1399,7 +1399,7 @@ impl Style {
fn text_styles_ui(ui: &mut Ui, text_styles: &mut BTreeMap<TextStyle, FontId>) -> Response { fn text_styles_ui(ui: &mut Ui, text_styles: &mut BTreeMap<TextStyle, FontId>) -> Response {
ui.vertical(|ui| { ui.vertical(|ui| {
crate::Grid::new("text_styles").show(ui, |ui| { crate::Grid::new("text_styles").show(ui, |ui| {
for (text_style, font_id) in text_styles.iter_mut() { for (text_style, font_id) in &mut *text_styles {
ui.label(RichText::new(text_style.to_string()).font(font_id.clone())); ui.label(RichText::new(text_style.to_string()).font(font_id.clone()));
crate::introspection::font_id_ui(ui, font_id); crate::introspection::font_id_ui(ui, font_id);
ui.end_row(); ui.end_row();

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false
default-run = "egui_demo_app" default-run = "egui_demo_app"

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Example library for egui" description = "Example library for egui"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/egui_demo_lib" homepage = "https://github.com/emilk/egui/tree/master/crates/egui_demo_lib"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -8,7 +8,7 @@ authors = [
] ]
description = "Extra functionality and widgets for the egui GUI library" description = "Extra functionality and widgets for the egui GUI library"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui" homepage = "https://github.com/emilk/egui"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Bindings for using egui natively using the glow library" description = "Bindings for using egui natively using the glow library"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/egui_glow" homepage = "https://github.com/emilk/egui/tree/master/crates/egui_glow"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -7,6 +7,7 @@ pub(crate) unsafe fn compile_shader(
shader_type: u32, shader_type: u32,
source: &str, source: &str,
) -> Result<glow::Shader, String> { ) -> Result<glow::Shader, String> {
unsafe {
let shader = gl.create_shader(shader_type)?; let shader = gl.create_shader(shader_type)?;
gl.shader_source(shader, source); gl.shader_source(shader, source);
@ -19,11 +20,13 @@ pub(crate) unsafe fn compile_shader(
Err(gl.get_shader_info_log(shader)) Err(gl.get_shader_info_log(shader))
} }
} }
}
pub(crate) unsafe fn link_program<'a, T: IntoIterator<Item = &'a glow::Shader>>( pub(crate) unsafe fn link_program<'a, T: IntoIterator<Item = &'a glow::Shader>>(
gl: &glow::Context, gl: &glow::Context,
shaders: T, shaders: T,
) -> Result<glow::Program, String> { ) -> Result<glow::Program, String> {
unsafe {
let program = gl.create_program()?; let program = gl.create_program()?;
for shader in shaders { for shader in shaders {
@ -38,3 +41,4 @@ pub(crate) unsafe fn link_program<'a, T: IntoIterator<Item = &'a glow::Shader>>(
Err(gl.get_program_info_log(program)) Err(gl.get_program_info_log(program))
} }
} }
}

View File

@ -276,7 +276,8 @@ impl Painter {
&mut self, &mut self,
[width_in_pixels, height_in_pixels]: [u32; 2], [width_in_pixels, height_in_pixels]: [u32; 2],
pixels_per_point: f32, pixels_per_point: f32,
) -> (u32, u32) { ) {
unsafe {
self.gl.enable(glow::SCISSOR_TEST); self.gl.enable(glow::SCISSOR_TEST);
// egui outputs mesh in both winding orders // egui outputs mesh in both winding orders
self.gl.disable(glow::CULL_FACE); self.gl.disable(glow::CULL_FACE);
@ -317,10 +318,9 @@ impl Painter {
self.vao.bind(&self.gl); self.vao.bind(&self.gl);
self.gl self.gl
.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, Some(self.element_array_buffer)); .bind_buffer(glow::ELEMENT_ARRAY_BUFFER, Some(self.element_array_buffer));
}
check_for_gl_error!(&self.gl, "prepare_painting"); check_for_gl_error!(&self.gl, "prepare_painting");
(width_in_pixels, height_in_pixels)
} }
pub fn clear(&self, screen_size_in_pixels: [u32; 2], clear_color: [f32; 4]) { pub fn clear(&self, screen_size_in_pixels: [u32; 2], clear_color: [f32; 4]) {
@ -377,14 +377,14 @@ impl Painter {
crate::profile_function!(); crate::profile_function!();
self.assert_not_destroyed(); self.assert_not_destroyed();
let size_in_pixels = unsafe { self.prepare_painting(screen_size_px, pixels_per_point) }; unsafe { self.prepare_painting(screen_size_px, pixels_per_point) };
for egui::ClippedPrimitive { for egui::ClippedPrimitive {
clip_rect, clip_rect,
primitive, primitive,
} in clipped_primitives } in clipped_primitives
{ {
set_clip_rect(&self.gl, size_in_pixels, pixels_per_point, *clip_rect); set_clip_rect(&self.gl, screen_size_px, pixels_per_point, *clip_rect);
match primitive { match primitive {
Primitive::Mesh(mesh) => { Primitive::Mesh(mesh) => {
@ -687,6 +687,7 @@ impl Painter {
} }
unsafe fn destroy_gl(&self) { unsafe fn destroy_gl(&self) {
unsafe {
self.gl.delete_program(self.program); self.gl.delete_program(self.program);
for tex in self.textures.values() { for tex in self.textures.values() {
self.gl.delete_texture(*tex); self.gl.delete_texture(*tex);
@ -697,6 +698,7 @@ impl Painter {
self.gl.delete_texture(*t); self.gl.delete_texture(*t);
} }
} }
}
/// This function must be called before [`Painter`] is dropped, as [`Painter`] has some OpenGL objects /// This function must be called before [`Painter`] is dropped, as [`Painter`] has some OpenGL objects
/// that should be deleted. /// that should be deleted.
@ -747,7 +749,7 @@ impl Drop for Painter {
fn set_clip_rect( fn set_clip_rect(
gl: &glow::Context, gl: &glow::Context,
size_in_pixels: (u32, u32), [width_px, height_px]: [u32; 2],
pixels_per_point: f32, pixels_per_point: f32,
clip_rect: Rect, clip_rect: Rect,
) { ) {
@ -764,15 +766,15 @@ fn set_clip_rect(
let clip_max_y = clip_max_y.round() as i32; let clip_max_y = clip_max_y.round() as i32;
// Clamp: // Clamp:
let clip_min_x = clip_min_x.clamp(0, size_in_pixels.0 as i32); let clip_min_x = clip_min_x.clamp(0, width_px as i32);
let clip_min_y = clip_min_y.clamp(0, size_in_pixels.1 as i32); let clip_min_y = clip_min_y.clamp(0, height_px as i32);
let clip_max_x = clip_max_x.clamp(clip_min_x, size_in_pixels.0 as i32); let clip_max_x = clip_max_x.clamp(clip_min_x, width_px as i32);
let clip_max_y = clip_max_y.clamp(clip_min_y, size_in_pixels.1 as i32); let clip_max_y = clip_max_y.clamp(clip_min_y, height_px as i32);
unsafe { unsafe {
gl.scissor( gl.scissor(
clip_min_x, clip_min_x,
size_in_pixels.1 as i32 - clip_max_y, height_px as i32 - clip_max_y,
clip_max_x - clip_min_x, clip_max_x - clip_min_x,
clip_max_y - clip_min_y, clip_max_y - clip_min_y,
); );

View File

@ -34,6 +34,7 @@ impl VertexArrayObject {
buffer_infos: Vec<BufferInfo>, buffer_infos: Vec<BufferInfo>,
) -> Self { ) -> Self {
let vao = if supports_vao(gl) { let vao = if supports_vao(gl) {
unsafe {
let vao = gl.create_vertex_array().unwrap(); let vao = gl.create_vertex_array().unwrap();
check_for_gl_error!(gl, "create_vertex_array"); check_for_gl_error!(gl, "create_vertex_array");
@ -58,6 +59,7 @@ impl VertexArrayObject {
gl.bind_vertex_array(None); gl.bind_vertex_array(None);
Some(vao) Some(vao)
}
} else { } else {
log::debug!("VAO not supported"); log::debug!("VAO not supported");
None None
@ -71,6 +73,7 @@ impl VertexArrayObject {
} }
pub(crate) unsafe fn bind(&self, gl: &glow::Context) { pub(crate) unsafe fn bind(&self, gl: &glow::Context) {
unsafe {
if let Some(vao) = self.vao { if let Some(vao) = self.vao {
gl.bind_vertex_array(Some(vao)); gl.bind_vertex_array(Some(vao));
check_for_gl_error!(gl, "bind_vertex_array"); check_for_gl_error!(gl, "bind_vertex_array");
@ -93,8 +96,10 @@ impl VertexArrayObject {
} }
} }
} }
}
pub(crate) unsafe fn unbind(&self, gl: &glow::Context) { pub(crate) unsafe fn unbind(&self, gl: &glow::Context) {
unsafe {
if self.vao.is_some() { if self.vao.is_some() {
gl.bind_vertex_array(None); gl.bind_vertex_array(None);
} else { } else {
@ -105,6 +110,7 @@ impl VertexArrayObject {
} }
} }
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Immediate mode plotting for the egui GUI library" description = "Immediate mode plotting for the egui GUI library"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui" homepage = "https://github.com/emilk/egui"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -1855,7 +1855,7 @@ where
.into_iter() .into_iter()
.enumerate() .enumerate()
.map(|(index, bar)| { .map(|(index, bar)| {
let bar_rect: Rect = transform.rect_from_values(&bar.bounds_min(), &bar.bounds_max()); let bar_rect = transform.rect_from_values(&bar.bounds_min(), &bar.bounds_max());
let dist_sq = bar_rect.distance_sq_to_pos(point); let dist_sq = bar_rect.distance_sq_to_pos(point);
ClosestElem { index, dist_sq } ClosestElem { index, dist_sq }

View File

@ -245,8 +245,7 @@ impl PlotPoints {
(0..points) (0..points)
.map(|i| { .map(|i| {
let t = start + i as f64 * increment; let t = start + i as f64 * increment;
let (x, y) = function(t); function(t).into()
[x, y]
}) })
.collect() .collect()
} }

View File

@ -1845,7 +1845,7 @@ impl PreparedPlot {
return Vec::new(); return Vec::new();
} }
let interact_radius_sq: f32 = (16.0f32).powi(2); let interact_radius_sq = (16.0_f32).powi(2);
let candidates = items.iter().filter_map(|item| { let candidates = items.iter().filter_map(|item| {
let item = &**item; let item = &**item;

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Minimal 2D math library for GUI work" description = "Minimal 2D math library for GUI work"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/emath" homepage = "https://github.com/emilk/egui/tree/master/crates/emath"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

View File

@ -4,7 +4,7 @@ version = "0.23.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Minimal 2D graphics library for GUI work" description = "Minimal 2D graphics library for GUI work"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
homepage = "https://github.com/emilk/egui/tree/master/crates/epaint" homepage = "https://github.com/emilk/egui/tree/master/crates/epaint"
license = "(MIT OR Apache-2.0) AND OFL-1.1 AND LicenseRef-UFL-1.0" # OFL and UFL used by default_fonts. See https://github.com/emilk/egui/issues/2321 license = "(MIT OR Apache-2.0) AND OFL-1.1 AND LicenseRef-UFL-1.0" # OFL and UFL used by default_fonts. See https://github.com/emilk/egui/issues/2321
readme = "README.md" readme = "README.md"

View File

@ -702,7 +702,7 @@ fn fill_closed_path(feathering: f32, path: &mut [PathPoint], color: Color32, out
if cw_signed_area(path) < 0.0 { if cw_signed_area(path) < 0.0 {
// Wrong winding order - fix: // Wrong winding order - fix:
path.reverse(); path.reverse();
for point in path.iter_mut() { for point in &mut *path {
point.normal = -point.normal; point.normal = -point.normal;
} }
} }
@ -772,7 +772,7 @@ fn fill_closed_path_with_uv(
if cw_signed_area(path) < 0.0 { if cw_signed_area(path) < 0.0 {
// Wrong winding order - fix: // Wrong winding order - fix:
path.reverse(); path.reverse();
for point in path.iter_mut() { for point in &mut *path {
point.normal = -point.normal; point.normal = -point.normal;
} }
} }

View File

@ -273,15 +273,18 @@ impl FontImpl {
if glyph_width == 0 || glyph_height == 0 { if glyph_width == 0 || glyph_height == 0 {
UvRect::default() UvRect::default()
} else { } else {
let glyph_pos = {
let atlas = &mut self.atlas.lock(); let atlas = &mut self.atlas.lock();
let (glyph_pos, image) = atlas.allocate((glyph_width, glyph_height)); let (glyph_pos, image) = atlas.allocate((glyph_width, glyph_height));
glyph.draw(|x, y, v| { glyph.draw(|x, y, v| {
if v > 0.0 { if 0.0 < v {
let px = glyph_pos.0 + x as usize; let px = glyph_pos.0 + x as usize;
let py = glyph_pos.1 + y as usize; let py = glyph_pos.1 + y as usize;
image[(px, py)] = v; image[(px, py)] = v;
} }
}); });
glyph_pos
};
let offset_in_pixels = vec2(bb.min.x, bb.min.y); let offset_in_pixels = vec2(bb.min.x, bb.min.y);
let offset = let offset =

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["tami5 <kkharji@proton.me>"] authors = ["tami5 <kkharji@proton.me>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Maxim Osipenko <maxim1999max@gmail.com>"] authors = ["Maxim Osipenko <maxim1999max@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Jan Procházka <github.com/jprochazk>"] authors = ["Jan Procházka <github.com/jprochazk>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Jose Palazon <jose@palako.com>"] authors = ["Jose Palazon <jose@palako.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["hacknus <l_stoeckli@bluewin.ch>"] authors = ["hacknus <l_stoeckli@bluewin.ch>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false
[dependencies] [dependencies]

View File

@ -7,7 +7,7 @@ authors = [
] ]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"] authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["konkitoman"] authors = ["konkitoman"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false
[features] [features]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["TicClick <ya@ticclick.ch>"] authors = ["TicClick <ya@ticclick.ch>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.70" rust-version = "1.72"
publish = false publish = false
[dependencies] [dependencies]

View File

@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'". # to the user in the error, instead of "error: invalid channel name '[toolchain]'".
[toolchain] [toolchain]
channel = "1.70.0" channel = "1.72.0"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"] targets = ["wasm32-unknown-unknown"]

View File

@ -6,7 +6,7 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Section identical to the root clippy.toml: # Section identical to the root clippy.toml:
msrv = "1.70" msrv = "1.72"
allow-unwrap-in-tests = true allow-unwrap-in-tests = true