You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: qubit_iterators.rs
    path of file: ./repos/RustQIP/qip-iterators/src/iterators
    
    the code of the file until where you have to start completion: use num_traits::{One, Zero};
use std::marker::PhantomData;

use crate::utils::*;

/// Iterator which provides the indices of nonzero columns for a given row of a matrix
#[derive(Debug)]
pub struct MatrixOpIterator<'a, P>
where
    P: Clone + Zero,
{
    n: usize,
    data: &'a [P],
    last_col: Option<usize>,
}

impl<'a, P> MatrixOpIterator<'a, P>
where
    P: Clone + Zero,
{
    /// Build a new itera
    
    fn next(&mut self) -> Option<Self::Item> {
        let pos = if let Some(last_col) = self.last_col {
            last_col + 1
        } else {
            0
        };
        self.last_col = None;
        for col in pos..(1 << self.n) {
            let val = &self.data[col];
            if !val.is_zero() {
                self.last_col = Some(col);
                return Some((col, val.clone()));
            }
        }
        None
    }