mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +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;
|
use unicode_width::UnicodeWidthStr;
|
||||||
|
|
||||||
/// Computes a sub-string length that fits in the given `width`.
|
// Computes a sub-string length that fits in the given `width`.
|
||||||
///
|
//
|
||||||
/// Takes non-breakable elements from `iter`, while keeping the
|
// Takes non-breakable elements from `iter`, while keeping the
|
||||||
/// string width under `width` (and adding the length of `delimiter`
|
// string width under `width` (and adding the length of `delimiter`
|
||||||
/// between each element).
|
// between each element).
|
||||||
///
|
//
|
||||||
/// Example:
|
// Example:
|
||||||
///
|
//
|
||||||
/// ```
|
// ```
|
||||||
/// let my_text = "blah...";
|
// let my_text = "blah...";
|
||||||
/// // This returns the number of bytes for a prefix of `my_text` that
|
// // This returns the number of bytes for a prefix of `my_text` that
|
||||||
/// // fits within 5 cells.
|
// // fits within 5 cells.
|
||||||
/// head_bytes(my_text.graphemes(true), 5, "");
|
// head_bytes(my_text.graphemes(true), 5, "");
|
||||||
/// ```
|
// ```
|
||||||
pub fn head_bytes<'a, I: Iterator<Item = &'a str>>(iter: I, width: usize,
|
pub fn head_bytes<'a, I: Iterator<Item = &'a str>>(iter: I, width: usize,
|
||||||
delimiter: &str)
|
delimiter: &str)
|
||||||
-> usize {
|
-> usize {
|
||||||
|
Loading…
Reference in New Issue
Block a user