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: rs_sender.rs
    path of file: ./repos/libpnet/benches
    
    the code of the file until where you have to start completion: // Copyright (c) 2014, 2015, 2022 Robert Clipsham <robert@octarineparrot.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except
    
pub fn build_udp4_packet(packet: &mut [u8], msg: &str) {
    let mut ip_header = build_ipv4_header(packet);
    let source = ip_header.get_source();
    let destination = ip_header.get_destination();
    let mut udp_header = build_udp_header(ip_header.payload_mut());

    {
        let data = udp_header.payload_mut();
        let msg = msg.as_bytes();
        data[0] = msg[0];
        data[1] = msg[1];
        data[2] = msg[2];
        data[3] = msg[3];
        data[4] = msg[4];
    }

    let checksum = udp::ipv4_checksum(&udp_header.to_immutable(), &source, &destination);
    udp_header.set_checksum(checksum);
}