Skip to content

Commit ca0e7b1

Browse files
committed
char_len is more succinct than count_chars.
1 parent cc477df commit ca0e7b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libextra/getopts.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ pub enum FailType {
501501
pub mod groups {
502502
use getopts::{HasArg, Long, Maybe, Multi, No, Occur, Opt, Optional, Req};
503503
use getopts::{Short, Yes};
504-
use std::str;
505504

506505
/** one group of options, e.g., both -h and --help, along with
507506
* their shared description and properties
@@ -692,7 +691,7 @@ pub mod groups {
692691

693692
// FIXME: #5516 should be graphemes not codepoints
694693
// here we just need to indent the start of the description
695-
let rowlen = str::count_chars(row, 0, row.len());
694+
let rowlen = row.char_len();
696695
if rowlen < 24 {
697696
do (24 - rowlen).times {
698697
row.push_char(' ')

0 commit comments

Comments
 (0)