Skip to content

Commit 6e2ed2f

Browse files
Timothy Zakiantzakian
Timothy Zakian
authored andcommitted
rename into_type_tag to to_type_tag on TypeInput
1 parent 81c0cbe commit 6e2ed2f

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

crates/sui-graphql-rpc/src/types/move_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl MoveType {
181181
&self,
182182
resolver: &PackageResolver,
183183
) -> Result<Option<A::MoveTypeLayout>, Error> {
184-
let Ok(tag) = self.native.into_type_tag() else {
184+
let Ok(tag) = self.native.to_type_tag() else {
185185
return Ok(None);
186186
};
187187

@@ -197,7 +197,7 @@ impl MoveType {
197197
&self,
198198
resolver: &PackageResolver,
199199
) -> Result<Option<AbilitySet>, Error> {
200-
let Ok(tag) = self.native.into_type_tag() else {
200+
let Ok(tag) = self.native.to_type_tag() else {
201201
return Ok(None);
202202
};
203203

crates/sui-replay-2/src/replay_txn.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,18 @@ fn get_packages(txn_data: &TransactionData) -> Result<BTreeSet<ObjectID>, Replay
210210
Command::MoveCall(move_call) => {
211211
packages.insert(move_call.package);
212212
for type_input in move_call.type_arguments.iter() {
213-
let typ = type_input.into_type_tag().map_err(|err| {
214-
ReplayError::GenericError {
215-
err: format!("{:?}", err),
216-
}
217-
})?;
213+
let typ =
214+
type_input
215+
.to_type_tag()
216+
.map_err(|err| ReplayError::GenericError {
217+
err: format!("{:?}", err),
218+
})?;
218219
packages_from_type_tag(&typ, &mut packages);
219220
}
220221
}
221222
Command::MakeMoveVec(type_input, _) => {
222223
if let Some(t) = type_input {
223-
let typ = t.into_type_tag().map_err(|err| ReplayError::GenericError {
224+
let typ = t.to_type_tag().map_err(|err| ReplayError::GenericError {
224225
err: format!("{:?}", err),
225226
})?;
226227
packages_from_type_tag(&typ, &mut packages);

crates/sui-types/src/type_input.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl TypeInput {
151151
/// Conversion to a `TypeTag`, which can fail if this value includes invalid identifiers.
152152
/// NB: This function should _not_ be used in the adapter or on the "write" side of transaction
153153
/// processing.
154-
pub fn into_type_tag(&self) -> Result<TypeTag> {
154+
pub fn to_type_tag(&self) -> Result<TypeTag> {
155155
use TypeInput as I;
156156
use TypeTag as T;
157157
Ok(match self {
@@ -164,7 +164,7 @@ impl TypeInput {
164164
I::U256 => T::U256,
165165
I::Address => T::Address,
166166
I::Signer => T::Signer,
167-
I::Vector(t) => T::Vector(Box::new(t.into_type_tag()?)),
167+
I::Vector(t) => T::Vector(Box::new(t.to_type_tag()?)),
168168
I::Struct(s) => {
169169
let StructInput {
170170
address,
@@ -174,7 +174,7 @@ impl TypeInput {
174174
} = s.as_ref();
175175
let type_params = type_params
176176
.iter()
177-
.map(|t| t.into_type_tag())
177+
.map(|t| t.to_type_tag())
178178
.collect::<Result<_>>()?;
179179
T::Struct(Box::new(StructTag {
180180
address: *address,

0 commit comments

Comments
 (0)