Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Dec 11, 2024
1 parent 39e15b5 commit 9ee70af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
6 changes: 5 additions & 1 deletion soroban-sdk/src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,13 @@ impl IntoIterator for Bytes {
pub struct BytesIter(Bytes);

impl BytesIter {
fn into_bin(self) -> Bytes {
pub fn into_bytes(self) -> Bytes {
self.0
}

pub fn to_bytes(&self) -> Bytes {
self.0.clone()
}
}

impl Iterator for BytesIter {
Expand Down
3 changes: 0 additions & 3 deletions soroban-sdk/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use core::fmt::Debug;
use crate::{contracttype, Bytes, Map};
use crate::{env::internal, unwrap::UnwrapInfallible, Env, IntoVal, Val, Vec};

// TODO: consolidate with host::events::TOPIC_BYTES_LENGTH_LIMIT
const TOPIC_BYTES_LENGTH_LIMIT: u32 = 32;

/// Events publishes events for the currently executing contract.
///
/// ```
Expand Down
1 change: 0 additions & 1 deletion soroban-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#![cfg_attr(target_family = "wasm", no_std)]
#![cfg_attr(feature = "docs", feature(doc_cfg))]
#![allow(dead_code)]
// The SDK uses #[test] in doctests, and does some sneaky line hiding to have
// the doctest execute the test inside a main function instead.
#![allow(clippy::test_attr_in_doctest)]
Expand Down
5 changes: 0 additions & 5 deletions soroban-sdk/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,6 @@ impl<K, V> Map<K, V> {
self.obj.to_val()
}

#[inline(always)]
pub(crate) fn as_object(&self) -> &MapObject {
&self.obj
}

#[inline(always)]
pub(crate) fn to_object(&self) -> MapObject {
self.obj
Expand Down
6 changes: 5 additions & 1 deletion soroban-sdk/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,11 @@ impl<T> VecTryIter<T> {
}
}

fn into_vec(self) -> Vec<T> {
pub fn into_vec(self) -> Vec<T> {
self.to_vec()
}

pub fn to_vec(&self) -> Vec<T> {
self.vec.slice(self.start..self.end)
}
}
Expand Down

0 comments on commit 9ee70af

Please sign in to comment.