diff --git a/core/src/moolsutra/std_ank.rs b/core/src/moolsutra/std_ank.rs index a16b1a4..daf07d6 100755 --- a/core/src/moolsutra/std_ank.rs +++ b/core/src/moolsutra/std_ank.rs @@ -6,7 +6,7 @@ use super::super::mulya::Mulya; /// this function converts a string to a number pub fn ank(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - let arg = args.get(0); + let arg = args.first(); if let Some(arg) = arg { let mut num = String::new(); let digit_mapping = ['०', '१', '२', '३', '४', '५', '६', '७', '८', '९']; diff --git a/core/src/moolsutra/std_kul.rs b/core/src/moolsutra/std_kul.rs index e592100..b4742fc 100755 --- a/core/src/moolsutra/std_kul.rs +++ b/core/src/moolsutra/std_kul.rs @@ -7,7 +7,7 @@ use super::super::mulya::Mulya; /// this function returns the length of the given string pub fn kul(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - let arg = args.get(0); + let arg = args.first(); if let Some(val) = arg { match val { Mulya::Vakya(string) => Ok(Mulya::Ank(string.s.len() as f64)), diff --git a/core/src/moolsutra/std_nirgam.rs b/core/src/moolsutra/std_nirgam.rs index 27429e6..6f2b46c 100755 --- a/core/src/moolsutra/std_nirgam.rs +++ b/core/src/moolsutra/std_nirgam.rs @@ -8,7 +8,7 @@ use super::super::mulya::Mulya; /// this function exits the program with the given exit code pub fn nirgam(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - let code = match args.get(0) { + let code = match args.first() { Some(Mulya::Ank(code)) => *code as i32, _ => 0, }; diff --git a/core/src/moolsutra/std_prakaar.rs b/core/src/moolsutra/std_prakaar.rs index 1084d90..b3bd99e 100755 --- a/core/src/moolsutra/std_prakaar.rs +++ b/core/src/moolsutra/std_prakaar.rs @@ -7,7 +7,7 @@ use super::super::mulya::Mulya; pub fn prakaar(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - if let Some(arg) = args.get(0) { + if let Some(arg) = args.first() { match arg { Mulya::Vakya(_v) => Ok(Mulya::Vakya(aadhaar.gc.intern("वाक्य".to_owned()))), Mulya::Ank(_v) => Ok(Mulya::Vakya(aadhaar.gc.intern("अंक".to_owned()))), diff --git a/core/src/moolsutra/std_shabd.rs b/core/src/moolsutra/std_shabd.rs index 7a38b8b..9735249 100755 --- a/core/src/moolsutra/std_shabd.rs +++ b/core/src/moolsutra/std_shabd.rs @@ -6,7 +6,7 @@ use super::super::mulya::Mulya; /// this function returns the given string pub fn shabd(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - let arg = args.get(0); + let arg = args.first(); if let Some(arg) = arg { Ok(Mulya::Vakya(aadhaar.gc.intern(arg.to_string()))) } else { diff --git a/core/src/moolsutra/std_truti.rs b/core/src/moolsutra/std_truti.rs index 3e23826..8b79f59 100755 --- a/core/src/moolsutra/std_truti.rs +++ b/core/src/moolsutra/std_truti.rs @@ -6,7 +6,7 @@ use super::super::mulya::Mulya; /// this function throws an dosa with the given string pub fn truti(aadhaar: &mut Aadhaar, from: usize) -> Result { let args = &aadhaar.rashi[from..aadhaar.rashi_len()]; - if let Some(arg) = args.get(0) { + if let Some(arg) = args.first() { let dosa = format!("त्रुटि : {arg}"); Err(aadhaar.throw_dosa(&dosa)) } else {