Skip to content

Commit

Permalink
syn: Fix having access to idl module by default (#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Oct 6, 2023
1 parent 51578bc commit 25b24a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 2 additions & 3 deletions lang/syn/src/idl/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pub mod types;

#[cfg(feature = "idl-build")]
pub mod build;

#[cfg(feature = "idl-parse")]
pub mod parse;

#[cfg(feature = "idl-types")]
pub mod types;
3 changes: 1 addition & 2 deletions lang/syn/src/idl/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct Idl {
Expand All @@ -19,7 +18,7 @@ pub struct Idl {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub errors: Option<Vec<IdlErrorCode>>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub metadata: Option<JsonValue>,
pub metadata: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
Expand Down
19 changes: 11 additions & 8 deletions lang/syn/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
pub mod codegen;
pub mod parser;

#[cfg(feature = "idl-types")]
pub mod idl;

#[cfg(feature = "hash")]
pub mod hash;
#[cfg(not(feature = "hash"))]
pub(crate) mod hash;

use crate::parser::tts_to_string;
use codegen::accounts as accounts_codegen;
use codegen::program as program_codegen;
Expand All @@ -18,14 +29,6 @@ use syn::{
TypePath,
};

pub mod codegen;
#[cfg(feature = "hash")]
pub mod hash;
#[cfg(not(feature = "hash"))]
pub(crate) mod hash;
pub mod idl;
pub mod parser;

#[derive(Debug)]
pub struct Program {
pub ixs: Vec<Ix>,
Expand Down

1 comment on commit 25b24a1

@vercel
Copy link

@vercel vercel bot commented on 25b24a1 Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-200ms.vercel.app
anchor-docs-git-master-200ms.vercel.app
www.anchor-lang.com
anchor-lang.com

Please sign in to comment.