Skip to content

Commit a209a2d

Browse files
author
Timothy Zakian
committed
rename as_type_tag to into_type_tag on TypeInput
1 parent 04150ca commit a209a2d

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
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.as_type_tag() else {
184+
let Ok(tag) = self.native.into_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.as_type_tag() else {
200+
let Ok(tag) = self.native.into_type_tag() else {
201201
return Ok(None);
202202
};
203203

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,17 @@ 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 =
214-
type_input
215-
.as_type_tag()
216-
.map_err(|err| ReplayError::GenericError {
217-
err: format!("{:?}", err),
218-
})?;
213+
let typ = type_input.into_type_tag().map_err(|err| {
214+
ReplayError::GenericError {
215+
err: format!("{:?}", err),
216+
}
217+
})?;
219218
packages_from_type_tag(&typ, &mut packages);
220219
}
221220
}
222221
Command::MakeMoveVec(type_input, _) => {
223222
if let Some(t) = type_input {
224-
let typ = t.as_type_tag().map_err(|err| ReplayError::GenericError {
223+
let typ = t.into_type_tag().map_err(|err| ReplayError::GenericError {
225224
err: format!("{:?}", err),
226225
})?;
227226
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 as_type_tag(&self) -> Result<TypeTag> {
154+
pub fn into_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.as_type_tag()?)),
167+
I::Vector(t) => T::Vector(Box::new(t.into_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.as_type_tag())
177+
.map(|t| t.into_type_tag())
178178
.collect::<Result<_>>()?;
179179
T::Struct(Box::new(StructTag {
180180
address: *address,

0 commit comments

Comments
 (0)