28 lines
534 B
Rust
28 lines
534 B
Rust
use crate::type_info::TypeInfo;
|
|
use std::fmt::{Display, Formatter};
|
|
use std::rc::Rc;
|
|
|
|
pub struct IrParameter {
|
|
name: Rc<str>,
|
|
type_info: TypeInfo,
|
|
}
|
|
|
|
impl IrParameter {
|
|
pub fn new(name: &str, type_info: TypeInfo) -> Self {
|
|
Self {
|
|
name: name.into(),
|
|
type_info,
|
|
}
|
|
}
|
|
|
|
pub fn type_info(&self) -> &TypeInfo {
|
|
&self.type_info
|
|
}
|
|
}
|
|
|
|
impl Display for IrParameter {
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "{}", self.name)
|
|
}
|
|
}
|