mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
Solve compiler warning about using deprecated item.
PutBackN::new() is replaced by put_back_n.
This commit is contained in:
parent
3b06a6e292
commit
7d7fc68dee
3 changed files with 7 additions and 6 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
use std::iter::Peekable;
|
||||
use std::slice::Iter;
|
||||
use itertools::PutBackN;
|
||||
use itertools::put_back_n;
|
||||
use cli;
|
||||
use tokenize::token::{Token, Tokenizer};
|
||||
use tokenize::unescaped_text::UnescapedText;
|
||||
|
@ -26,7 +26,7 @@ impl Memo {
|
|||
pub fn new(pf_string: &String, pf_args_it: &mut Peekable<Iter<String>>) -> Memo {
|
||||
let mut pm = Memo { tokens: Vec::new() };
|
||||
let mut tmp_token: Option<Box<Token>>;
|
||||
let mut it = PutBackN::new(pf_string.chars());
|
||||
let mut it = put_back_n(pf_string.chars());
|
||||
let mut has_sub = false;
|
||||
loop {
|
||||
tmp_token = UnescapedText::from_it(&mut it, pf_args_it);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
//! Primitives used by num_format and sub_modules.
|
||||
//! never dealt with above (e.g. Sub Tokenizer never uses these)
|
||||
|
||||
use std::str::Chars;
|
||||
use itertools::PutBackN;
|
||||
use itertools::{PutBackN, put_back_n};
|
||||
use cli;
|
||||
use super::format_field::FormatField;
|
||||
|
||||
|
@ -57,7 +58,7 @@ pub trait Formatter {
|
|||
fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String;
|
||||
}
|
||||
pub fn get_it_at(offset: usize, str_in: &str) -> PutBackN<Chars> {
|
||||
PutBackN::new(str_in[offset..].chars())
|
||||
put_back_n(str_in[offset..].chars())
|
||||
}
|
||||
|
||||
// TODO: put this somewhere better
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::iter::Peekable;
|
|||
use std::str::Chars;
|
||||
use std::process::exit;
|
||||
use cli;
|
||||
use itertools::PutBackN;
|
||||
use itertools::{PutBackN, put_back_n};
|
||||
use super::token;
|
||||
use super::unescaped_text::UnescapedText;
|
||||
use super::num_format::format_field::{FormatField, FieldType};
|
||||
|
@ -371,7 +371,7 @@ impl token::Token for Sub {
|
|||
})
|
||||
}
|
||||
'b' => {
|
||||
let mut a_it = PutBackN::new(arg_string.chars());
|
||||
let mut a_it = put_back_n(arg_string.chars());
|
||||
UnescapedText::from_it_core(&mut a_it, true);
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue