Skip to content

Commit

Permalink
*_list -> *_items
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 11, 2022
1 parent 0efd231 commit eaabe62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions examples/tao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() {
let edit_m = Submenu::new("Edit", true);
let window_m = Submenu::new("Window", true);

menu_bar.append_list(&[&file_m, &edit_m, &window_m]);
menu_bar.append_items(&[&file_m, &edit_m, &window_m]);

let custom_i_1 = TextMenuItem::new("C&ustom 1", true, None);
let custom_i_2 = TextMenuItem::new(
Expand All @@ -47,14 +47,14 @@ fn main() {
let cut_i = predefined::cut(None);
let paste_i = predefined::paste(None);

file_m.append_list(&[
file_m.append_items(&[
&custom_i_1,
&custom_i_2,
&predefined::separator(),
&check_custom_i_1,
]);

window_m.append_list(&[
window_m.append_items(&[
&check_custom_i_2,
&predefined::close_window(None),
&predefined::separator(),
Expand All @@ -73,7 +73,7 @@ fn main() {
&custom_i_1,
]);

edit_m.append_list(&[&copy_i, &predefined::separator(), &cut_i]);
edit_m.append_items(&[&copy_i, &predefined::separator(), &cut_i]);

edit_m.prepend(&paste_i);
window_m.insert(&cut_i, 2);
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Menu {

pub fn with_items(items: &[&dyn MenuItem]) -> Self {
let menu = Self::new();
menu.append_list(items);
menu.append_items(items);
menu
}

Expand All @@ -55,7 +55,7 @@ impl Menu {
self.0.append(item)
}

pub fn append_list(&self, items: &[&dyn MenuItem]) {
pub fn append_items(&self, items: &[&dyn MenuItem]) {
for item in items {
self.append(*item);
}
Expand All @@ -64,7 +64,7 @@ impl Menu {
self.0.prepend(item)
}

pub fn prepend_list(&self, items: &[&dyn MenuItem]) {
pub fn prepend_items(&self, items: &[&dyn MenuItem]) {
for item in items {
self.prepend(*item);
}
Expand All @@ -74,7 +74,7 @@ impl Menu {
self.0.insert(item, position)
}

pub fn insert_list(&self, items: &[&dyn MenuItem], position: usize) {
pub fn insert_items(&self, items: &[&dyn MenuItem], position: usize) {
for (i, item) in items.iter().enumerate() {
self.insert(*item, position + i)
}
Expand Down Expand Up @@ -245,7 +245,7 @@ impl Submenu {

pub fn with_items<S: AsRef<str>>(text: S, enabled: bool, items: &[&dyn MenuItem]) -> Self {
let menu = Self::new(text, enabled);
menu.append_list(items);
menu.append_items(items);
menu
}

Expand All @@ -257,7 +257,7 @@ impl Submenu {
self.0.append(item)
}

pub fn append_list(&self, items: &[&dyn MenuItem]) {
pub fn append_items(&self, items: &[&dyn MenuItem]) {
for item in items {
self.append(*item);
}
Expand All @@ -266,7 +266,7 @@ impl Submenu {
self.0.prepend(item)
}

pub fn prepend_list(&self, items: &[&dyn MenuItem]) {
pub fn prepend_items(&self, items: &[&dyn MenuItem]) {
for item in items {
self.prepend(*item);
}
Expand All @@ -276,7 +276,7 @@ impl Submenu {
self.0.insert(item, position)
}

pub fn insert_list(&self, items: &[&dyn MenuItem], position: usize) {
pub fn insert_items(&self, items: &[&dyn MenuItem], position: usize) {
for (i, item) in items.iter().enumerate() {
self.insert(*item, position + i)
}
Expand Down

0 comments on commit eaabe62

Please sign in to comment.