Thursday, January 9, 2020

What types are heap-allocated in Rust

Today I stumbled on this question regarding which standard Rust types do alloc in the heap. I have this question popping in my head quite often, so here are the heap-allocated ones:

  • Box, simple heap allocation;
  • Rc, reference counter;
  • Arc, thread-safe atomic reference counter;
  • collections.

Reference to the answer can be found here.

Monday, January 6, 2020

Firefox: can’t see menu separators in Linux

In Linux, I was having a problem when using Firefox. After some version update, the menu separator lines simply disappear. After searching around after a solution to this very annoying problem, I found another userChrome.css customization:

/* Make separators in menus easier to see */
menuseparator {
  -moz-appearance: none !important; /* nothing changes without this */
  background: #d4d2d1 !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 3px 5px !important;
}

Make sure it’s loading is enabled. After restarting Firefox, the menu separators were back in all their glory.