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: lib.rs
    path of file: ./repos/noseyparker/crates/progress/src
    
    the code of the file until where you have to start completion: use indicatif::{ProgressBar, ProgressStyle};
use std::borrow::Cow;
use std::time::{Duration, Instant};

/// How often should progress bars be redrawn?
pub const PROGRESS_UPDATE_INTERVAL: Duration = Duration::from_millis(50
    
    pub fn new_bar<T: Into<Cow<'static, str>>>(total: u64, message: T, enabled: bool) -> Self {
        let style = ProgressStyle::with_template(
            "{msg}  {bar} {percent:>3}%  {pos}/{len}  [{elapsed_precise}]",
        )
        .expect("progress bar style template should compile");

        let inner = if enabled {
            let inner = ProgressBar::new(total)
                .with_style(style)
                .with_message(message);
            inner.enable_steady_tick(PROGRESS_UPDATE_INTERVAL);

            inner
        } else {
            ProgressBar::hidden()
        };

        Progress {
            inc_since_sync: 0,
            last_sync: Instant::now(),
            inner,
            finish_style: None,
        }
    }