mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
chore: various cleanups, version bump 0.4.12
This commit is contained in:
@@ -428,7 +428,7 @@ pub fn matchSingleVCardPrefixedField(
|
||||
if values.is_empty() {
|
||||
return None;
|
||||
}
|
||||
Some(values.get(0)?.clone())
|
||||
Some(values.first()?.clone())
|
||||
// return values == null || values.isEmpty() ? null : values.get(0);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ fn toPrimaryValue(list: Option<Vec<String>>) -> String {
|
||||
if l.is_empty() {
|
||||
String::default()
|
||||
} else {
|
||||
l.get(0).unwrap_or(&String::default()).clone()
|
||||
l.first().unwrap_or(&String::default()).clone()
|
||||
}
|
||||
} else {
|
||||
String::default()
|
||||
@@ -471,7 +471,7 @@ fn toTypes(lists: Option<Vec<Vec<String>>>) -> Vec<String> {
|
||||
let mut result = Vec::with_capacity(local_lists.len()); //new ArrayList<>(lists.size());
|
||||
for list in local_lists {
|
||||
// for (List<String> list : lists) {
|
||||
if let Some(value) = list.get(0) {
|
||||
if let Some(value) = list.first() {
|
||||
if !value.is_empty() {
|
||||
let mut v_type = String::new();
|
||||
let final_value = list.last().unwrap_or(&String::default()).clone();
|
||||
|
||||
@@ -152,7 +152,7 @@ fn matchVCardPrefixedField(prefix: &str, rawText: &str) -> Vec<String> {
|
||||
for (i, res) in result.iter_mut().enumerate().take(size) {
|
||||
// for i in 0..size {
|
||||
// for (int i = 0; i < size; i++) {
|
||||
*res = values.get(i).unwrap().get(0).unwrap().clone();
|
||||
*res = values.get(i).unwrap().first().unwrap().clone();
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user