Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::path::Path doesn't implement Reflect in 0.9 #6739

Closed
Xion opened this issue Nov 23, 2022 · 1 comment
Closed

std::path::Path doesn't implement Reflect in 0.9 #6739

Xion opened this issue Nov 23, 2022 · 1 comment
Labels
A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Milestone

Comments

@Xion
Copy link

Xion commented Nov 23, 2022

Code similar to the following used to work in 0.8.x:

use std::path::Path;

/// Path to the storage database.
#[derive(Clone, Copy, Debug, Default, Eq, Hash,  PartialEq, Reflect)]
pub enum StoragePath {
    /// In-memory database for testing.
    #[default]
    Memory,

    /// Database stored in an application- & platform-specific directory in the filesystem
    Filesystem(&'static Path),
}

In 0.9, it looks like &Path doesn't implement Reflect anymore (which would be a strange oversight), or at least the derive doesn't work correctly when a Path field is inside an enum variant.

@Xion Xion added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 23, 2022
@MrGVSV MrGVSV added D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 23, 2022
@MrGVSV
Copy link
Member

MrGVSV commented Nov 23, 2022

I think the main thing is adding the impl for Path itself. Not sure if that will handle the &Path case, but at least adds support for this missing type.

@alice-i-cecile alice-i-cecile added this to the 0.9.1 milestone Nov 23, 2022
@bors bors bot closed this as completed in 03bde74 Nov 26, 2022
cart pushed a commit that referenced this issue Nov 30, 2022
# Objective

Fixes #6739 

## Solution

Implement the required traits. They cannot be implemented for `Path` directly, since it is a dynamically-sized type.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Fixes bevyengine#6739 

## Solution

Implement the required traits. They cannot be implemented for `Path` directly, since it is a dynamically-sized type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants