Skip to content

Commit

Permalink
re-add wgpu_snapshot etc... methods as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Dec 30, 2024
1 parent 93fc290 commit 1ef8ad1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
15 changes: 1 addition & 14 deletions crates/egui_kittest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,7 @@ impl<'a, State> Harness<'a, State> {
/// Press a key.
/// This will create a key down event and a key up event.
pub fn press_key(&mut self, key: egui::Key) {
self.input.events.push(egui::Event::Key {
key,
pressed: true,
modifiers: Default::default(),
repeat: false,
physical_key: None,
});
self.input.events.push(egui::Event::Key {
key,
pressed: false,
modifiers: Default::default(),
repeat: false,
physical_key: None,
});
self.press_key_modifiers(Modifiers::default(), key);
}

/// Press a key with modifiers.
Expand Down
42 changes: 42 additions & 0 deletions crates/egui_kittest/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,45 @@ impl<State> Harness<'_, State> {
}
}
}

// Deprecated wgpu_snapshot functions
// TODO(lucasmerlin): Remove in 0.32
#[allow(clippy::missing_errors_doc)]
#[cfg(feature = "wgpu")]
impl<State> Harness<'_, State> {
#[deprecated(
since = "0.31.0",
note = "Use `try_snapshot_options` instead. This function will be removed in 0.32"
)]
pub fn try_wgpu_snapshot_options(
&mut self,
name: &str,
options: &SnapshotOptions,
) -> Result<(), SnapshotError> {
self.try_snapshot_options(name, options)
}

#[deprecated(
since = "0.31.0",
note = "Use `try_snapshot` instead. This function will be removed in 0.32"
)]
pub fn try_wgpu_snapshot(&mut self, name: &str) -> Result<(), SnapshotError> {
self.try_snapshot(name)
}

#[deprecated(
since = "0.31.0",
note = "Use `snapshot_options` instead. This function will be removed in 0.32"
)]
pub fn wgpu_snapshot_options(&mut self, name: &str, options: &SnapshotOptions) {
self.snapshot_options(name, options);
}

#[deprecated(
since = "0.31.0",
note = "Use `snapshot` instead. This function will be removed in 0.32"
)]
pub fn wgpu_snapshot(&mut self, name: &str) {
self.snapshot(name);
}
}

0 comments on commit 1ef8ad1

Please sign in to comment.