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: visibility.rs
    path of file: ./repos/mun/crates/mun_hir/src
    
    the code of the file until where you have to start completion: use std::iter::successors;

use mun_syntax::ast;

use crate::{
    ids::ModuleId,
    module_tree::{LocalModuleId, ModuleTree},
    DefDatabase, HirDatabase, Resolver,
};

/// Visibility of an item, not yet resolved to an a
    
    pub fn is_visible_from(self, db: &dyn HirDatabase, from_module: ModuleId) -> bool {
        let to_module = match self {
            Visibility::Module(m) => m,
            Visibility::Public => return true,
        };

        let module_tree = db.module_tree(from_module.package);
        let mut ancestors = successors(Some(from_module.local_id), |m| module_tree[*m].parent);

        ancestors.any(|m| m == to_module.local_id)
    }