Skip to content

Commit

Permalink
lits
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Nov 22, 2023
1 parent 592d13d commit 5a376d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/src/ast/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ pub enum TypeName {
/// A `Result<T, E>` or `diplomat_runtime::DiplomatWriteable` type. If the bool is true, it's `Result`
Result(Box<TypeName>, Box<TypeName>, bool),
Writeable,
/// A `&str` type.
/// A `&DiplomatWtf8` type.
StrReference(Lifetime),
/// A `&[T]` type, where `T` is a primitive.
PrimitiveSlice(Lifetime, Mutability, PrimitiveType),
Expand Down Expand Up @@ -494,7 +494,7 @@ impl TypeName {
diplomat_runtime::DiplomatWriteable
},
TypeName::StrReference(lifetime) => syn::parse_str(&format!(
"{}str",
"{}DiplomatWtf8",
ReferenceDisplay(lifetime, &Mutability::Immutable)
))
.unwrap(),
Expand Down Expand Up @@ -522,7 +522,7 @@ impl TypeName {
/// - If the type is a path with a single element [`Result`], returns a [`TypeName::Result`] with the type parameters recursively converted
/// - If the type is a path equal to [`diplomat_runtime::DiplomatResult`], returns a [`TypeName::DiplomatResult`] with the type parameters recursively converted
/// - If the type is a path equal to [`diplomat_runtime::DiplomatWriteable`], returns a [`TypeName::Writeable`]
/// - If the type is a reference to `str`, returns a [`TypeName::StrReference`]
/// - If the type is a reference to `DiplomatWtf8`, returns a [`TypeName::StrReference`]
/// - If the type is a reference to a slice of a Rust primitive, returns a [`TypeName::PrimitiveSlice`]
/// - If the type is a reference (`&` or `&mut`), returns a [`TypeName::Reference`] with the referenced type recursively converted
/// - Otherwise, assume that the reference is to a [`CustomType`] in either the current module or another one, returns a [`TypeName::Named`]
Expand Down Expand Up @@ -919,7 +919,7 @@ impl fmt::Display for TypeName {
TypeName::StrReference(lifetime) => {
write!(
f,
"{}str",
"{}DiplomatWtf8",
ReferenceDisplay(lifetime, &Mutability::Immutable)
)
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/hir/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum SelfType {
#[derive(Copy, Clone, Debug)]
#[non_exhaustive]
pub enum Slice {
/// A string slice, e.g. `&str`.
/// A string slice, e.g. `&DiplomatWtf8`.
Str(MaybeStatic<TypeLifetime>),

/// A primitive slice, e.g. `&mut [u8]`.
Expand Down

0 comments on commit 5a376d6

Please sign in to comment.