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: proxies.rs
    path of file: ./repos/mullvadvpn-app/mullvad-cli/src/cmds
    
    the code of the file until where you have to start completion: use clap::Args;
use std::net::{IpAddr, SocketAddr};
use talpid_types::net::{
    proxy::{Sha
    
    pub fn merge_socks_remote(self, remote: &Socks5Remote) -> Result<Socks5Remote, Error> {
        let ip = self.ip.unwrap_or(remote.endpoint.ip());
        let port = self.port.unwrap_or(remote.endpoint.port());
        let config = match &remote.auth {
            None => match (self.username, self.password) {
                (Some(username), Some(password)) => {
                    let auth = SocksAuth::new(username, password)?;
                    Socks5Remote::new_with_authentication((ip, port), auth)
                }
                (None, None) => Socks5Remote::new((ip, port)),
                _ => {
                    println!("Remote SOCKS5 proxy does not have a username and password set already, so you must provide both or neither when you edit.");
                    Socks5Remote::new((ip, port))
                }
            },
            Some(credentials) => {
                let username = self.username.unwrap_or(credentials.username().to_string());
                let password = self.password.unwrap_or(credentials.password().to_string());
                let auth = SocksAuth::new(username, password)?;
                Socks5Remote::new_with_authentication((ip, port), auth)
            }
        };
        Ok(config)
    }