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: help.rs
    path of file: ./repos/clash-nyanpasu/backend/tauri/src/utils
    
    the code of the file until where you have to start completion: use crate::config::nyanpasu::ExternalControllerPortStrategy;
use anyhow::{anyhow, bail, Context, Result};
use display_info::DisplayInfo;
use fast_image_resize as fr;
use image::{codecs::png::PngEncoder, io::Reader as ImageReader, ColorType, ImageEncoder};
use nanoid::nanoid;
use serde::{de::DeserializeOwned, Serialize};
use serde_yaml
    
pub fn get_max_scale_factor() -> f64 {
    match DisplayInfo::all() {
        Ok(displays) => {
            let mut scale_factor = 0.0;
            debug!("displays: {:?}", displays);
            for display in displays {
                if display.scale_factor > scale_factor {
                    scale_factor = display.scale_factor;
                }
            }
            scale_factor as f64
        }
        Err(err) => {
            warn!("failed to get display info: {:?}", err);
            1.0_f64
        }
    }
}