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: to_timestamp.rs
    path of file: ./repos/risingwave/src/expr/impl/src/scalar
    
    the code of the file until where you have to start completion: // Copyright 2024 RisingWave Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may 
    
pub fn to_timestamp_legacy(s: &str, tmpl: &ChronoPattern) -> Result<Timestamp> {
    let parsed = parse(s, tmpl)?;
    match parsed.offset {
        None => Ok(parsed.to_naive_datetime_with_offset(0)?.into()),
        // If the parsed result is a physical instant, return its reading in UTC.
        // This decision was arbitrary and we are just being backward compatible here.
        Some(_) => timestamptz_at_time_zone(parsed.to_datetime()?.into(), "UTC"),
    }
}