Skip to content

Commit

Permalink
Remove ScSpecTypeSet support, which was already mostly dead.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Aug 11, 2023
1 parent df9334d commit e9e6ad8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ rev = "e6ba45c60c16de28c7522586b80ed0150157df73"
[workspace.dependencies.stellar-xdr]
version = "0.0.17"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "4876e5eb20016caebbd13bcf6401626dc6073b8e"
rev = "74178ad4c71989c1f8596e2e102c2cc5f252dc17"
default-features = false

#[patch."https://github.com/stellar/rs-soroban-env"]
Expand Down
14 changes: 1 addition & 13 deletions soroban-sdk-macros/src/map_type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use stellar_xdr::{
ScSpecTypeBytesN, ScSpecTypeDef, ScSpecTypeMap, ScSpecTypeOption, ScSpecTypeResult,
ScSpecTypeSet, ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec,
ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec,
};
use syn::{
spanned::Spanned, Error, Expr, ExprLit, GenericArgument, Lit, Path, PathArguments, PathSegment,
Expand Down Expand Up @@ -86,18 +86,6 @@ pub fn map_type(t: &Type) -> Result<ScSpecTypeDef, Error> {
element_type: Box::new(map_type(t)?),
})))
}
"Set" => {
let t = match args.as_slice() {
[GenericArgument::Type(t)] => t,
[..] => Err(Error::new(
t.span(),
"incorrect number of generic arguments, expect one for Set<T>",
))?,
};
Ok(ScSpecTypeDef::Set(Box::new(ScSpecTypeSet {
element_type: Box::new(map_type(t)?),
})))
}
"Map" => {
let (k, v) = match args.as_slice() {
[GenericArgument::Type(k), GenericArgument::Type(v)] => (k, v),
Expand Down
4 changes: 0 additions & 4 deletions soroban-spec-rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ pub fn generate_type_ident(spec: &ScSpecTypeDef) -> TokenStream {
let value_ident = generate_type_ident(&m.value_type);
quote! { soroban_sdk::Map<#key_ident, #value_ident> }
}
ScSpecTypeDef::Set(s) => {
let element_ident = generate_type_ident(&s.element_type);
quote! { soroban_sdk::Set<#element_ident> }
}
ScSpecTypeDef::Tuple(t) => {
let type_idents = t.value_types.iter().map(generate_type_ident);
quote! { (#(#type_idents,)*) }
Expand Down

0 comments on commit e9e6ad8

Please sign in to comment.