mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-08 02:26:42 +01:00
remove redundant generic
This commit is contained in:
parent
870bf249d8
commit
d26c46d6e1
3 changed files with 6 additions and 8 deletions
|
|
@ -1,9 +1,8 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct Columns<T, G, S>(pub Vec<Column<T, G, S>>);
|
||||
pub struct Columns<G, S>(pub Vec<Column<G, S>>);
|
||||
|
||||
pub struct Column<T, G, S> {
|
||||
__: std::marker::PhantomData<T>,
|
||||
pub struct Column<G, S> {
|
||||
pub title: Arc<str>,
|
||||
pub width: usize,
|
||||
pub getter: G,
|
||||
|
|
@ -11,7 +10,7 @@ pub struct Column<T, G, S> {
|
|||
//pub styler: Option<U>,
|
||||
}
|
||||
|
||||
impl<T> Column<T, fn(&T)->Option<Arc<str>>, fn(&mut [T], usize, &str)> {
|
||||
impl<T> Column<fn(&T)->Option<Arc<str>>, fn(&mut [T], usize, &str)> {
|
||||
pub fn new (
|
||||
title: &impl AsRef<str>,
|
||||
width: usize,
|
||||
|
|
@ -22,7 +21,6 @@ impl<T> Column<T, fn(&T)->Option<Arc<str>>, fn(&mut [T], usize, &str)> {
|
|||
title: title.as_ref().into(),
|
||||
getter,
|
||||
setter: None,
|
||||
__: Default::default(),
|
||||
}
|
||||
}
|
||||
fn setter (mut self, setter: fn(&mut [T], usize, &str)) -> Self {
|
||||
|
|
@ -45,7 +43,7 @@ macro_rules! setter {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Columns<Entry, fn(&Entry)->Option<Arc<str>>, fn(&mut [Entry], usize, &str)> {
|
||||
impl Default for Columns<fn(&Entry)->Option<Arc<str>>, fn(&mut [Entry], usize, &str)> {
|
||||
fn default () -> Self {
|
||||
Self(vec![
|
||||
Column::new(&"Hash", 8, |entry: &Entry|entry.hash()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue