上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 491 下一页
摘要: This lesson talks about Integer types in Rust and that there are unsigned and signed integers. It also explains how every the type names are composed 阅读全文
posted @ 2024-02-19 21:25 Zhentiw 阅读(11) 评论(0) 推荐(0)
摘要: This lesson explains Type Inference in Rust and how it allows the compiler to figure out by itself, what type variables have when they get their value 阅读全文
posted @ 2024-02-19 21:17 Zhentiw 阅读(42) 评论(0) 推荐(0)
摘要: // interface {} is the same as `any` type in Typscript func add(inputs []int) interface {} { return inputs[0].Float() + inputs[1].Float() } 阅读全文
posted @ 2024-02-19 20:58 Zhentiw 阅读(11) 评论(0) 推荐(0)
摘要: use anyhow::{Result, anyhow}; use std::str::FromStr; fn get_input() -> &'static str { return "0,9 -> 5,9 8,0 -> 0,8 9,4 -> 3,4 2,2 -> 2,1 7,0 -> 7,4 6 阅读全文
posted @ 2024-02-19 16:00 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "log" "strconv" "strings" ) type Point struct { x int y int } type Line struct { p1 *Point p2 *Point } func getInput() str 阅读全文
posted @ 2024-02-19 15:58 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要: Golang has no built-in function(s) to filter an array. This lesson will teach you two different ways to filter. The first is to create a separate arra 阅读全文
posted @ 2024-02-18 04:05 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: There are numerous ways that you can declare and create arrays and slices in Go. This lesson will show you several and I talk about the advantages and 阅读全文
posted @ 2024-02-18 03:58 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: In Rust, the exclamation mark (!) after a name indicates that it is a macro rather than a function. Macros and functions in Rust are called differentl 阅读全文
posted @ 2024-02-15 16:11 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: We can use Reusltenum to do error handling type Result<V, E> { Err(E), Ok(V) } Example: // (): empty // uszie: just return a integre as error for demo 阅读全文
posted @ 2024-02-15 16:09 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要: pub enum Option2<T> { None, Some(T) } /** impl is similar to typescript a class with is_some method */ impl<T> Option2<T> { pub fn is_some(&self) -> b 阅读全文
posted @ 2024-02-13 16:04 Zhentiw 阅读(8) 评论(0) 推荐(0)
上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 491 下一页