What is Nostr?
musicmatze :rust: :nixos: /
npub1ja6…jwly
2024-10-28 09:32:19

musicmatze :rust: :nixos: on Nostr: Doing #rust code generation like a pro: ``` cat src/base.rs | grep "serde(rename" -A ...

Doing #rust code generation like a pro:

```
cat src/base.rs | grep "serde(rename" -A 1 | grep -v op_id | grep -v opId | grep -E ",$" | cut -d "(" -f 1 | sed 's,^\ *,,' | while read name; do echo "#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct $name { }" > src/operation/"$(echo "$name" | tr '[A-Z]' '[a-z]')".rs ; done
```
Author Public Key
npub1ja605u7e86q8n5ptvyyh5z4wy0ucjre4a7vsgzhvjhgdauhjfcns6mjwly