mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Don't compile internal doc example
Won't compile anyway since it's not public
This commit is contained in:
parent
6e021867ab
commit
2e5262096a
28
src/utils.rs
28
src/utils.rs
@ -1,19 +1,19 @@
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
/// Computes a sub-string length that fits in the given `width`.
|
||||
///
|
||||
/// Takes non-breakable elements from `iter`, while keeping the
|
||||
/// string width under `width` (and adding the length of `delimiter`
|
||||
/// between each element).
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```
|
||||
/// let my_text = "blah...";
|
||||
/// // This returns the number of bytes for a prefix of `my_text` that
|
||||
/// // fits within 5 cells.
|
||||
/// head_bytes(my_text.graphemes(true), 5, "");
|
||||
/// ```
|
||||
// Computes a sub-string length that fits in the given `width`.
|
||||
//
|
||||
// Takes non-breakable elements from `iter`, while keeping the
|
||||
// string width under `width` (and adding the length of `delimiter`
|
||||
// between each element).
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// ```
|
||||
// let my_text = "blah...";
|
||||
// // This returns the number of bytes for a prefix of `my_text` that
|
||||
// // fits within 5 cells.
|
||||
// head_bytes(my_text.graphemes(true), 5, "");
|
||||
// ```
|
||||
pub fn head_bytes<'a, I: Iterator<Item = &'a str>>(iter: I, width: usize,
|
||||
delimiter: &str)
|
||||
-> usize {
|
||||
|
Loading…
Reference in New Issue
Block a user