Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nathaniel McCallum
    @npmccallum
    @haraldh Isn't that part of clippy::all?
    Harald Hoyer
    @haraldh
    nope
    Nathaniel McCallum
    @npmccallum
    Then, yes please.
    Harald Hoyer
    @haraldh
    Does the CI clippy ?
    Nathaniel McCallum
    @npmccallum
    @haraldh It is supposed to. If not, it is a bug.
    Harald Hoyer
    @haraldh
    Hmm, then I don't add it :) .. only to my own crates :)
    Nathaniel McCallum
    @npmccallum
    ACK
    Harald Hoyer
    @haraldh
    We should probably file issues for every crate then? IDK..
    Or an issue with a check list
    Nathaniel McCallum
    @npmccallum
    Yes, one of those.
    An issue with a check list is probably good.
    Harald Hoyer
    @haraldh
    Now where is this We when you need him... what does he do the whole day?
    Nathaniel McCallum
    @npmccallum
    haha
    Harald Hoyer
    @haraldh
    where is our intern?
    Nathaniel McCallum
    @npmccallum
    I'm now rethinking this clippy.
    It errors on a lot of things.
    Harald Hoyer
    @haraldh
    hehe
    yeah, that's why it isn't the default
    Nathaniel McCallum
    @npmccallum
    And it isn't clear how to fix the problem.
    Harald Hoyer
    @haraldh
    I'll keep it on, until it hurts too much
    Lily Sturmann
    @lkatalin
    @npmccallum Unsure if unwrap_or_else change is related to docs, but the rest looks good on enarx/enarx#533
    Nathaniel McCallum
    @npmccallum
    @lkatalin Same. I'm not sure what precisely triggered the compiler warning. But it is fixed now.
    Lily Sturmann
    @lkatalin
    Approved it
    Harald Hoyer
    @haraldh
    @npmccallum Oh... #![deny(clippy::integer_arithmetic)] really helps thinking about corner cases... e.g. I turned your: https://github.com/enarx/enarx/blob/master/enarx-keep-sgx/src/layout.rs#L19-L24
    into
    fn raise(value: usize, boundary: usize) -> Option<usize> {
        value
            .checked_add(boundary)
            .and_then(|v| v.checked_sub(1))
            .map(|v| lower(v, boundary))
    }
    Nathaniel McCallum
    @npmccallum
    :thumbsup:
    Harald Hoyer
    @haraldh
    and if you know you don't have to check, just put it in a block with
    #[allow(clippy::integer_arithmetic)]
    {
       // whatever
    }
    it's like unsafe {}
    Harald Hoyer
    @haraldh
    ok, scratch my last comment.. only works for functions ... doh!
    #[inline(always)]
    const fn lower(value: usize, boundary: usize) -> usize {
        #![allow(clippy::integer_arithmetic)]
        // integer_arithmetic checked
        value / boundary * boundary
    }
    
    #[inline(always)]
    fn raise(value: usize, boundary: usize) -> Option<usize> {
        value
            .checked_add(boundary)
            .map(|v| v.wrapping_sub(1))
            .map(|v| lower(v, boundary))
    }
    one can write wrapping_*
    haraldh @haraldh heads to bed.. gn8
    Nathaniel McCallum
    @npmccallum
    In a macro that I'm writing, I need an attribute that has no effect to satisfy the parser. Something like #[cfg(true)]. Any suggestions?
    Harald Hoyer
    @haraldh
    #[allow(missing_docs)]
    #[cfg(not(feature = "unlikely_to_exist_feature"))
    Connor Kuehl
    @connorkuehl
    [cfg(noop)] ?
    can we define one like that
    Harald Hoyer
    @haraldh
    #[cfg(not(__my_macro_name_undefined_cfg = ""))]
    if it has to be cfg.. @npmccallum say something :)
    Nathaniel McCallum
    @npmccallum
    It doesn't.
    @haraldh I'm currently using your first suggestion.
    Harald Hoyer
    @haraldh
    good :)
    Harald Hoyer
    @haraldh
    rust turned 5
    Connor Kuehl
    @connorkuehl
    same
    Harald Hoyer
    @haraldh
    hehe
    Lily Sturmann
    @lkatalin
    lol
    Mark Bestavros
    @mbestavros
    @npmccallum I have very positive news re. the runner: the public image (https://github.com/joeyx22lm/docker-github-actions-runner) should work exactly as we need it to, as long as we can store a Github-provided token securely on the Packet server.
    Nathaniel McCallum
    @npmccallum
    @mbestavros That shouldn't be a problem. Just get it into the kickstart and we should be good to go!
    Mark Bestavros
    @mbestavros
    In other words, if the container stops, we can invoke the same command (with the same token) after a reboot to restart the same runner, with the same name. We shouldn't need any manual interaction apart from initially provisioning the token.
    Nathaniel McCallum
    @npmccallum
    That's great!