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: utils.rs
    path of file: ./repos/deep_causality/ultragraph/benches/benchmarks
    
    the code of the file until where you have to start completion: // SPDX-License-Identifier: MIT
// Copyright (c) "2023" . The DeepCausality Authors. All Rights Reserved.

use ultragraph::prelude::*;

use crate::benchmarks::data::Data;

pub fn build_linear_graph(k: usize) -> UltraGraph<Data> {
    let mut g = ultragraph::new_with_matrix_storage::<Data>(k);
    let d = Data::default();

    let root_index = g.add_root_node(d);
    let mut previous_idx = root_index;

    for _ in 0..k {
        // add a new causaloid and set current idx to it
        le
    
pub fn build_linear_graph(k: usize) -> UltraGraph<Data> {
    let mut g = ultragraph::new_with_matrix_storage::<Data>(k);
    let d = Data::default();

    let root_index = g.add_root_node(d);
    let mut previous_idx = root_index;

    for _ in 0..k {
        // add a new causaloid and set current idx to it
        let data = Data::default();
        let current_idx = g.add_node(data);

        // link current causaloid to previos causaloid
        g.add_edge(previous_idx, current_idx)
            .expect("Failed to add edge");

        previous_idx = current_idx;
    }

    g
}