Skip to content

[Migrated] Support Option<T> #139

Open
@rust-gpu-bot

Description

@rust-gpu-bot

Issue automatically imported from old repo: EmbarkStudios/rust-gpu#234
Old labels: t: bug,c: rustc_codegen_spirv,s: qptr may fix
Originally creatd by fu5ha on 2020-11-12T18:04:17Z


Expected Behaviour

Be able to use Option<Mat4>

Example & Steps To Reproduce

Use an Option that contains a value larger than some threshold

    pub fn from_mat4(t: &Mat4) -> Option<Self> {
        let (scale3, rotation, translation) = t.to_scale_rotation_translation();
        if scale3.abs_diff_eq(Vec3::splat(1.0), 1e-4) {
            Some(Self::from_rotation_translation(rotation, translation))
        } else {
            None
        }
    }

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions