mod context;
mod function_pointer;
mod names;
mod parameter_impl_trait;
mod paths;
mod sort_key;
mod types;
use crate::PackageIndex;
use super::vertex::{FunctionContext, TypeSignatureComponent};
pub(super) fn fn_param_or_return_type_signature<'a>(
crate_: &'a PackageIndex<'a>,
function: FunctionContext<'a>,
component: TypeSignatureComponent,
type_: Option<&'a rustdoc_types::Type>,
) -> String {
let mut context = context::FnNormalizationContext::new(crate_, function);
match (component, type_) {
(TypeSignatureComponent::FunctionParameter(position), Some(type_)) => {
types::format_parameter_type(&mut context, position, type_)
}
(TypeSignatureComponent::ReturnValue, Some(type_)) => {
types::format_type(&mut context, type_)
}
(_, None) => "()".to_string(), }
}