Skip to content

Commit

Permalink
program error: use unambigious globs (#6590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe C authored Apr 18, 2024
1 parent e00605d commit 0762aad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libraries/program-error/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spl-program-error"
version = "0.4.0"
version = "0.4.1"
description = "Library for Solana Program error attributes and derive macro for creating them"
authors = ["Solana Labs Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana-program-library"
Expand All @@ -11,7 +11,7 @@ edition = "2021"
num-derive = "0.4"
num-traits = "0.2"
solana-program = ">=1.18.2,<=2"
spl-program-error-derive = { version = "0.4.0", path = "./derive" }
spl-program-error-derive = { version = "0.4.1", path = "./derive" }
thiserror = "1.0"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion libraries/program-error/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spl-program-error-derive"
version = "0.4.0"
version = "0.4.1"
description = "Proc-Macro Library for Solana Program error attributes and derive macro"
authors = ["Solana Labs Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana-program-library"
Expand Down
14 changes: 7 additions & 7 deletions libraries/program-error/derive/src/macro_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ impl MacroType {
/// implements `From<Self> for solana_program::program_error::ProgramError`
pub fn into_program_error(ident: &Ident) -> proc_macro2::TokenStream {
quote! {
impl From<#ident> for solana_program::program_error::ProgramError {
impl From<#ident> for ::solana_program::program_error::ProgramError {
fn from(e: #ident) -> Self {
solana_program::program_error::ProgramError::Custom(e as u32)
::solana_program::program_error::ProgramError::Custom(e as u32)
}
}
}
Expand All @@ -61,7 +61,7 @@ pub fn into_program_error(ident: &Ident) -> proc_macro2::TokenStream {
/// Builds the implementation of `solana_program::decode_error::DecodeError<T>`
pub fn decode_error(ident: &Ident) -> proc_macro2::TokenStream {
quote! {
impl<T> solana_program::decode_error::DecodeError<T> for #ident {
impl<T> ::solana_program::decode_error::DecodeError<T> for #ident {
fn type_of() -> &'static str {
stringify!(#ident)
}
Expand All @@ -81,18 +81,18 @@ pub fn print_program_error(
.unwrap_or_else(|| String::from("Unknown custom program error"));
quote! {
#ident::#variant_ident => {
solana_program::msg!(#error_msg)
::solana_program::msg!(#error_msg)
}
}
});
quote! {
impl solana_program::program_error::PrintProgramError for #ident {
impl ::solana_program::program_error::PrintProgramError for #ident {
fn print<E>(&self)
where
E: 'static
+ std::error::Error
+ solana_program::decode_error::DecodeError<E>
+ solana_program::program_error::PrintProgramError
+ ::solana_program::decode_error::DecodeError<E>
+ ::solana_program::program_error::PrintProgramError
+ num_traits::FromPrimitive,
{
match self {
Expand Down

0 comments on commit 0762aad

Please sign in to comment.