1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Replace Id::null() with Id::NULL (#3544)

Shorter and more idiomatic
This commit is contained in:
Emil Ernerfeldt
2023-11-11 21:40:02 +01:00
committed by GitHub
parent b27aa27e94
commit 6ba356d3d8
6 changed files with 17 additions and 20 deletions

View File

@@ -807,7 +807,7 @@ impl Plot {
if let Some((name, _)) = linked_axes.as_ref() {
ui.memory_mut(|memory| {
let link_groups: &mut BoundsLinkGroups =
memory.data.get_temp_mut_or_default(Id::null());
memory.data.get_temp_mut_or_default(Id::NULL);
link_groups.0.remove(name);
});
};
@@ -892,7 +892,7 @@ impl Plot {
// Find the cursors from other plots we need to draw
let draw_cursors: Vec<Cursor> = if let Some((id, _)) = linked_cursors.as_ref() {
ui.memory_mut(|memory| {
let frames: &mut CursorLinkGroups = memory.data.get_temp_mut_or_default(Id::null());
let frames: &mut CursorLinkGroups = memory.data.get_temp_mut_or_default(Id::NULL);
let cursors = frames.0.entry(*id).or_default();
// Look for our previous frame
@@ -921,7 +921,7 @@ impl Plot {
if let Some((id, axes)) = linked_axes.as_ref() {
ui.memory_mut(|memory| {
let link_groups: &mut BoundsLinkGroups =
memory.data.get_temp_mut_or_default(Id::null());
memory.data.get_temp_mut_or_default(Id::NULL);
if let Some(linked_bounds) = link_groups.0.get(id) {
if axes.x {
bounds.set_x(&linked_bounds.bounds);
@@ -1164,7 +1164,7 @@ impl Plot {
if let Some((id, _)) = linked_cursors.as_ref() {
// Push the frame we just drew to the list of frames
ui.memory_mut(|memory| {
let frames: &mut CursorLinkGroups = memory.data.get_temp_mut_or_default(Id::null());
let frames: &mut CursorLinkGroups = memory.data.get_temp_mut_or_default(Id::NULL);
let cursors = frames.0.entry(*id).or_default();
cursors.push(PlotFrameCursors {
id: plot_id,
@@ -1177,7 +1177,7 @@ impl Plot {
// Save the linked bounds.
ui.memory_mut(|memory| {
let link_groups: &mut BoundsLinkGroups =
memory.data.get_temp_mut_or_default(Id::null());
memory.data.get_temp_mut_or_default(Id::NULL);
link_groups.0.insert(
*id,
LinkedBounds {