Skip to content

Commit

Permalink
add explicit panic to stay backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
maxomatic458 committed Jan 27, 2024
1 parent 0493c0d commit d6ab845
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/menu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ pub enum MenuEvent {
/// Trait that defines how a menu will be printed by the painter
pub trait Menu: Send {
/// Get MenuSettings
fn settings(&self) -> &MenuSettings;
fn settings(&self) -> &MenuSettings {

Check warning on line 69 in src/menu/mod.rs

View workflow job for this annotation

GitHub Actions / build-lint-test (ubuntu-latest, stable, bashisms)

Diff in /home/runner/work/reedline/reedline/src/menu/mod.rs

Check warning on line 69 in src/menu/mod.rs

View workflow job for this annotation

GitHub Actions / build-lint-test (ubuntu-latest, stable, default)

Diff in /home/runner/work/reedline/reedline/src/menu/mod.rs

Check warning on line 69 in src/menu/mod.rs

View workflow job for this annotation

GitHub Actions / build-lint-test (ubuntu-latest, stable, sqlite)

Diff in /home/runner/work/reedline/reedline/src/menu/mod.rs

Check warning on line 69 in src/menu/mod.rs

View workflow job for this annotation

GitHub Actions / build-lint-test (ubuntu-latest, stable, basqlite)

Diff in /home/runner/work/reedline/reedline/src/menu/mod.rs

Check warning on line 69 in src/menu/mod.rs

View workflow job for this annotation

GitHub Actions / build-lint-test (ubuntu-latest, stable, external_printer)

Diff in /home/runner/work/reedline/reedline/src/menu/mod.rs
// We panic here, so this function has base implementation
// so existing menus will not break.
// if a breaking change is ok, this can be removed
panic!("`settings` requires a manual implementation per menu. It has a base implementation to not break existing menus")
}

/// Menu name
fn name(&self) -> &str {
Expand Down

0 comments on commit d6ab845

Please sign in to comment.