Skip to content

Fix AssetServer lifetimes#15533

Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom
ChosenName:main
Sep 30, 2024
Merged

Fix AssetServer lifetimes#15533
alice-i-cecile merged 2 commits intobevyengine:mainfrom
ChosenName:main

Conversation

@ChosenName
Copy link
Copy Markdown
Contributor

Objective

  • Adds a separate lifetimes for AssetSourceId

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-Assets Load files from disk to use for things like images, models, and sounds S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Sep 30, 2024
Copy link
Copy Markdown
Contributor

@kristoff3r kristoff3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but I think these can be simplified. There's also other functions in the same file that has unused 'a lifetimes.

Comment on lines +221 to +223
pub async fn get_path_asset_loader<'a, 'b>(
&self,
path: impl Into<AssetPath<'a>>,
path: impl Into<AssetPath<'b>>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, doesn't this mean the same thing? Also 'a is no longer used.

Comment on lines +134 to 137
pub fn get_source<'a, 'b>(
&'a self,
source: impl Into<AssetSourceId<'a>>,
source: impl Into<AssetSourceId<'b>>,
) -> Result<&'a AssetSource, MissingAssetSourceError> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be written as (I can't do a suggestion because it touches unchanged lines)

    pub fn get_source<'a>(
        &self,
        source: impl Into<AssetSourceId<'a>>,
    ) -> Result<&AssetSource, MissingAssetSourceError> {

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 30, 2024
Merged via the queue into bevyengine:main with commit 07caf35 Sep 30, 2024
robtfm pushed a commit to robtfm/bevy that referenced this pull request Oct 4, 2024
# Objective

- Adds a separate lifetimes for AssetSourceId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants