“ArmanRiazirustvecsomepop” Código de respuesta

ArmanRiazirustvecsomepop


  // make this a while let statement - remember that vector.pop also adds another layer of Option<T>
  // You can stack `Option<T>`'s into while let and if let
  while let Some(Some(value)) = optional_values_vec.pop() {
      println!("current value: {}", value);
  }
ArmanRiazi

ArmanRiazirustvec

// <4> A "Vec" type is shorthand for vector. Vectors are arrays that will dynamically expand when needed.
// The underscore asks the the compiler to infer the type of the vector's elements.
        let fields: Vec<_> = record 
ArmanRiazi

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código