mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
a2f0fe24e8
# Objective Make it easier to build and use an asset path with `format!()`. This can be useful for accessing assets in a loop. Enabled by this PR: ```rust let monkey_handle = asset_server.get_handle(&format!("models/monkey/Monkey.gltf#Mesh0/Primitive0")); let monkey_handle = asset_server.get_handle(format!("models/monkey/Monkey.gltf#Mesh0/Primitive0")); ``` Before this PR: ```rust let monkey_handle = asset_server.get_handle(format!("models/monkey/Monkey.gltf#Mesh0/Primitive0").as_str()); ``` It's just a tiny improvement in ergonomics, but i ran into it and was wondering why the function does not accept a `String` and Bevy is all about simplicity/ergonomics, right? 😄😉 ## Solution Implement `Into<HandleId>` for `String` and `&String`. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |