Skip to content

memory-management: rename as_dependency to to_dependency#3173

Open
m4tx wants to merge 1 commit intogoogle:mainfrom
m4tx:to-dependency
Open

memory-management: rename as_dependency to to_dependency#3173
m4tx wants to merge 1 commit intogoogle:mainfrom
m4tx:to-dependency

Conversation

@m4tx
Copy link
Copy Markdown

@m4tx m4tx commented Apr 23, 2026

Because this function takes a reference to self and returns an owned object, it's more idiomatic to call it to_ rather than as_: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

This was brought up when discussing the code with the students when running the course.

Because this function takes a reference to `self` and returns an owned
object, it's more idiomatic to call it `to_` rather than `as_`:
https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

This was brought up when discussing the code with the students when
running the course.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant