Giter VIP home page Giter VIP logo

Comments (2)

Miroito avatar Miroito commented on May 30, 2024

I'm willing to open a PR for this, I want to make sure I have the right idea because I didn't spend enough time in the project to understand what this code does. Here's my idea:

The trait MakeRx looks like this (without the doc comments):

pub trait MakeRx {
    type Rx: MakeUnrx;
    #[cfg(debug_assertions)]
    const HSR_IGNORE: bool = false;
    fn make_rx(self) -> Self::Rx;
}

Meaning HSR_IGNORE is available on types that implement the MakeRx trait only on debug builds.

But the functions get_frozen_state_and_register and get_frozen_global_state_and_register both have this condition:

if *is_hsr && S::HSR_IGNORE {
    return Ok(None);
}

Which has no guard to not be compiled in non-debug builds.

I would propose to simply guard either the full condition, or split it in order to prevent the compiler from tying to find HSR_IGNORE on non-debug builds.
Or perhaps HSR_IGNORE should be defined on all builds and in this case we would just remove it from the trait definition.

Please let me know, I'm willing to open a PR if it is a simple change (again because of my light understanding of what is actually going on there) or feel free to fix it quickly.

PS; I'm surprised something like this would not be picked up while trying to build the library in release mode, I haven't tried though.

from perseus.

arctic-hen7 avatar arctic-hen7 commented on May 30, 2024

Oh I'm an idiot, thank you very much, you're absolutely right. PR would be great! (I'll also check up on the CLI tests, which should have caught this...)

from perseus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.