nucleo-picker 0.3.0

A fuzzy picker tui library based on nucleo
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! # Column fill helper functions for an [`Injector`](nucleo::Injector)
//! This module contains helper functions that are intended to be used as the `fill_columns`
//! argument for the [`Injector::push`](nucleo::Injector::push) function.
//! It is straightforward to write such a function yourself if you want to customize the fill
//! behaviour in any way.
use nucleo::Utf32String;

/// Fill an item into the first column using its [`ToString`] or [`Display`](std::fmt::Display)
/// implementation.
pub fn fill_as_string<I: ToString>(item: &I, cols: &mut [Utf32String]) {
    cols[0] = item.to_string().into();
}