wulf

joined 1 year ago
[–] wulf@lemmy.world 0 points 4 days ago

Same here, Keep also let's you tab in items, so we have it sorted by isle too. Makes shopping so much easier

[–] wulf@lemmy.world 1 points 1 week ago

LXC is much more light weight than VMs, so it's not as much overhead. I've done it this way in case I need to reboot a container (or something goes wrong with an update) without disrupting the other services

Also keeps it consistent since I have some services that don't run in docker. One service per LXC

[–] wulf@lemmy.world 2 points 2 weeks ago (7 children)

I run a different LXC on Proxmox for every service, so it's a bunch. Probably a better way to do it since most of those just run a docker container inside them.

[–] wulf@lemmy.world 4 points 1 month ago

Vast majority of sites work for me (librewolf), but for the few that don't I also have Vivaldi installed

[–] wulf@lemmy.world 1 points 1 month ago (1 children)

Both of these are on f-droid

My favorite e-reader is Cool Reader(granted, it was last updated 3 years ago)

My favorite music player is innerTune (however that is more for playing YouTube vids as music)

[–] wulf@lemmy.world 6 points 1 month ago

Second impression of Garuda (Arch based). My first impression was the dragonized version, which is KDE with lots of mods to make it Mac like, but with extra window animations.

I like things simple, so when I tried Garuda again, I installed the Gnome version. Other than some weirdness getting my Nvidia card working with Wayland, it has run better than anything else on my laptop.

[–] wulf@lemmy.world 13 points 1 month ago

Fully agree with this. There will be a slight learning curve since it will be different from what your used to, but it's friendly enough to figure out.

If you know the windows program you want to use just search something like "Linux alternative for x" (sometimes there is specific KDE or Gnome progs)

[–] wulf@lemmy.world 6 points 1 month ago

Invidious is awesome, if possible, self hosting one in docker is great and keeps it up to date

0
submitted 11 months ago* (last edited 11 months ago) by wulf@lemmy.world to c/programming@programming.dev
 

Background: I have a large serde_json value that I want to be read-only (the authoritative source is an encrypted SQLite DB and should only be updated when that gets updated)

The issue, I would like a single get function that returns a generic type

use serde_json;

pub struct Configuration {
    config: serde_json::Value,
}

impl Configuration {
    async fn get(&self, key: &str) -> Result {
        let tmp_value: = &self.config["test"];

        // This would be repeated for String, bool, etc
        if tmp_value.is_i64() {
            match tmp_value.as_i64 {
                Some(x) => Ok(x),
                Err(e) => Err(()),
            }
        } else {
            Err(())
        }
    }
}

However I get: "mismatched types expected type parameter T found type i64"

Is it even possible to return multiple types from a single function?

EDIT: SOLUTION

Here is the solution I came up with:

pub struct Configuration {}

impl Configuration {
    fn get std::str::FromStr>() -> Result {
        Ok(T::from_str("1234");
    }
}

fn main() {
    let my_conf_val = Configuration::get();
}