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: theme.rs
    path of file: ./repos/erdtree/src/render
    
    the code of the file until where you have to start completion: use crate::{
    styles::{self, ThemesMap},
    tree::node::Node,
};
use ansi_term::{Color, Style};
use std::borrow::Cow;

type Theme = Box<dyn FnMut(&Node) -> &'static ThemesMap>;

/// Returns a closure that retrieves the r
    
pub fn link_theme_getter() -> Theme {
    let mut link_depth = None;

    Box::new(move |node| {
        let current_depth = node.depth();

        if let Some(ldepth) = link_depth {
            if current_depth == ldepth {
                link_depth = None;
            }
        }

        if link_depth.is_some() || node.is_symlink() {
            if node.is_dir() && link_depth.is_none() {
                link_depth = Some(current_depth);
            }
            styles::get_link_theme().unwrap()
        } else {
            styles::get_tree_theme().unwrap()
        }
    })
}