【Rust日报】 2019-06-21:Typestate 模式

IntelliJ Rust 又更新了 #100

主要新增了 const 常數關鍵字的高亮支持

read more

Scriptkeeper

一個輔助測試 Bash 的程式

假如你原本有個

#!/usr/bin/env bash

if [ -z "$(git status --porcelain)" ] ; then
  commit=$(git rev-parse HEAD)
  docker build --tag image_name:$commit .
else
  exit 1
fi

你可以改成 toml 的格式

tests:
  # builds a docker image when git repo is clean
  - steps:
    - command: /usr/bin/git status --porcelain
      stdout: ""
    - command: /usr/bin/git rev-parse HEAD
      stdout: "mock_commit_hash\n"
    - /usr/bin/docker build --tag image_name:mock_commit_hash .
  # aborts when git repo is not clean
  - steps:
    - command: /usr/bin/git status --porcelain
      stdout: " M some-file"
    exitcode: 1

read more

教學:升級到Actix Web 1.0

原本用 actix 0.7 要升級到1.0的可以看

read more

IOTA現在需要rust高手

IOTA是一種區塊鍊 可以遠端

要會英文,需要帶team 的程式主管職

read more

Rust Streams

一篇非同步讀寫 stream 教學

read more

為什麼我們要選rust

老生常談了,速度快、記憶體安全、平行計算能力

read more

Typestate 模式

typestate 是一種API設計原則

讓對象的某些函數在特定狀態下才可用,如果在錯誤的狀態便會不能編譯

這有個好處,是將執行期錯誤轉為編譯期,消除運行時檢查讓代碼更小更快

來看看作者怎麼說吧?

read more


From 日报小组 @Damody

日报订阅地址:

独立日报订阅地址:

社区学习交流平台订阅:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值