mirror of
https://github.com/uutils/coreutils
synced 2024-12-18 09:03:14 +00:00
Some lint changes
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
parent
403910aed2
commit
6ff826b712
1 changed files with 4 additions and 8 deletions
|
@ -173,18 +173,14 @@ impl Sequence {
|
||||||
u32::from(a.chars().next().unwrap()),
|
u32::from(a.chars().next().unwrap()),
|
||||||
u32::from(b.chars().next().unwrap()),
|
u32::from(b.chars().next().unwrap()),
|
||||||
);
|
);
|
||||||
if start >= 48 && start <= 90 && end >= 48 && end <= 90 && end > start {
|
if (48..=90).contains(&start) && (48..=90).contains(&end) && end > start {
|
||||||
Sequence::CharRange(
|
Sequence::CharRange(
|
||||||
(start..=end)
|
(start..=end)
|
||||||
.map(|c| std::char::from_u32(c).unwrap())
|
.map(|c| std::char::from_u32(c).unwrap())
|
||||||
.collect(),
|
.collect(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Sequence::CharRange(
|
Sequence::CharRange((start..=end).filter_map(std::char::from_u32).collect())
|
||||||
(start..=end)
|
|
||||||
.filter_map(|c| std::char::from_u32(c))
|
|
||||||
.collect(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -320,7 +316,7 @@ pub enum TranslateOperationNew {
|
||||||
|
|
||||||
impl TranslateOperationNew {
|
impl TranslateOperationNew {
|
||||||
fn next_complement_char(mut iter: u32) -> (u32, char) {
|
fn next_complement_char(mut iter: u32) -> (u32, char) {
|
||||||
while let None = char::from_u32(iter) {
|
while char::from_u32(iter).is_none() {
|
||||||
iter = iter.saturating_add(1)
|
iter = iter.saturating_add(1)
|
||||||
}
|
}
|
||||||
(iter, char::from_u32(iter).unwrap())
|
(iter, char::from_u32(iter).unwrap())
|
||||||
|
@ -382,7 +378,7 @@ impl SymbolTranslatorNew for TranslateOperationNew {
|
||||||
if let Some(c) = set1.iter().find(|c| c.eq(&¤t)) {
|
if let Some(c) = set1.iter().find(|c| c.eq(&¤t)) {
|
||||||
Some(*c)
|
Some(*c)
|
||||||
} else {
|
} else {
|
||||||
while let None = mapped_characters.get(¤t) {
|
while mapped_characters.get(¤t).is_none() {
|
||||||
if let Some(p) = set2.pop() {
|
if let Some(p) = set2.pop() {
|
||||||
let (next_index, next_value) =
|
let (next_index, next_value) =
|
||||||
TranslateOperationNew::next_complement_char(*iter);
|
TranslateOperationNew::next_complement_char(*iter);
|
||||||
|
|
Loading…
Reference in a new issue