Don’t duplicate methods on items which implement Deref

This commit is contained in:
Tobie Morgan Hitchcock 2022-05-05 08:06:04 +01:00
parent 4824f1b627
commit 683039e08f
5 changed files with 0 additions and 45 deletions

View file

@ -13,15 +13,6 @@ use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Groups(pub Vec<Group>);
impl Groups {
pub fn len(&self) -> usize {
self.0.len()
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl Deref for Groups {
type Target = Vec<Group>;
fn deref(&self) -> &Self::Target {

View file

@ -17,15 +17,6 @@ use std::str;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Idioms(pub Vec<Idiom>);
impl Idioms {
pub fn len(&self) -> usize {
self.0.len()
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl Deref for Idioms {
type Target = Vec<Idiom>;
fn deref(&self) -> &Self::Target {

View file

@ -14,15 +14,6 @@ use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Orders(pub Vec<Order>);
impl Orders {
pub fn len(&self) -> usize {
self.0.len()
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl Deref for Orders {
type Target = Vec<Order>;
fn deref(&self) -> &Self::Target {

View file

@ -13,15 +13,6 @@ use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Splits(pub Vec<Split>);
impl Splits {
pub fn len(&self) -> usize {
self.0.len()
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl Deref for Splits {
type Target = Vec<Split>;
fn deref(&self) -> &Self::Target {

View file

@ -52,15 +52,6 @@ static MATCHER: Lazy<SkimMatcherV2> = Lazy::new(|| SkimMatcherV2::default().igno
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct Values(pub Vec<Value>);
impl Values {
pub fn len(&self) -> usize {
self.0.len()
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl Deref for Values {
type Target = Vec<Value>;
fn deref(&self) -> &Self::Target {