• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Hooooooey
V2EX  ›  程序员

搬运: MoonBit 现已通过重载字面量原生支持 JSON 处理

  •  
  •   Hooooooey · Aug 1, 2024 · 1578 views
    This topic created in 661 days ago, the information mentioned may be changed or developed.
    兼具动态语言的灵活性和静态语言的安全高效,使用 MoonBit ,解析和转换 JSON 数据结构变得非常直观和简洁
    [img][/img]
    2 replies    2024-08-02 15:55:38 +08:00
    NessajCN
        1
    NessajCN  
       Aug 2, 2024
    不太行
    Rust 里这么改 key 肯定是先 #[derive(Deserialize)] 定义个结构体交给 serde 反序列化
    后另起一个新 struct 重新序列化的
    一般没人这么直接操作 Hashmap ,更不会直接去动 raw json 字符串
    lisxour
        2
    lisxour  
       Aug 2, 2024
    这么说吧,没学过 rust 的大致都能看得懂下面的代码,但是上面的代码,你搁这画符抓鬼还是写正则呢?

    这么几行代码,符号占一半,我用了我都怕我睡觉做噩梦
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5413 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 03:53 · PVG 11:53 · LAX 20:53 · JFK 23:53
    ♥ Do have faith in what you're doing.