#tock

/

      • Guest55489 is now known as jayaura
      • niklasad1_ joined the channel
      • kaksmet has quit
      • kaksmet joined the channel
      • niklasad1_ has quit
      • niklasad1_ joined the channel
      • niklasad1_ has quit
      • niklasad1_ joined the channel
      • niklasad1_ has quit
      • niklasad1_ joined the channel
      • niklasad1_ has quit
      • niklasad1
        @alevy what do you mean by "Please inline document these branches to make it a bit easier to follow the logic."? do you want more comments? please clarify I don't understand
      • alevy
        Oh woops... That was a typo. Yes I meant add comments inline. That was just a place I had to read a couple times to understand what was going on
      • niklasad1_ joined the channel
      • niklasad1_
        good now I understand
      • well I have moved to static mut arr to a cell arr
      • to mutate the Cell I do the following " let mut arr = self.randomness.get(); arr[e] = regs.VALUE.get() as u8;" self.randomness.set(arr);
      • it's not that elegant but works. do you know a quick way to access element directly in the array? for example self.randomness[e].set(x)?
      • alevy
        niklasad1 You could make the field a `[Cell<u32>; 4]`which would in technically give you what you want, but then extracting it would be a bummer. Alternatively, you could make the field a `MapCell<[u8; 4]>` and call `map` to get a mutable reference to the array, but it would "cost" an extra word of storage
      • Cell in this case is a bit gross, but not terrible i think
      • niklasad1_ ^
      • niklasad1_
        @alevy :) I will keep the horrible 3 lines at the moment then
      • alevy
        👍
      • niklasad1_ has quit