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: type_names.rs
    path of file: ./repos/grafbase/engine/crates/engine/src/registry
    
    the code of the file until where you have to start completion: //! Various types for working with GraphQL type names

use std::borrow::{Borrow, Cow};

use engine_value::Name;

use super::{
    type_kinds::{InputType, OutputType, SelectionSetTarget},
    MetaType, ObjectType,
};

/// A trait for types that represent ty
    
fn named_type_from_type_str(meta: &str) -> &str {
    let mut nested = Some(meta);

    if meta.starts_with('[') && meta.ends_with(']') {
        nested = nested.and_then(|x| x.strip_prefix('['));
        nested = nested.and_then(|x| x.strip_suffix(']'));
        return named_type_from_type_str(nested.expect("Can't fail"));
    }

    if meta.ends_with('!') {
        nested = nested.and_then(|x| x.strip_suffix('!'));
        return named_type_from_type_str(nested.expect("Can't fail"));
    }

    nested.expect("Can't fail")
}