上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 467 下一页
摘要: Code: import type { paths } from "@octokit/openapi-types"; type OrgRepoResponse = paths["/repos/{owner}/{repo}"]["get"]["responses"]["200"]["content"] 阅读全文
posted @ 2024-04-19 14:25 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: The following code has compiler error: fn jazz(years: &[i64]) -> Releases { let eighties: [i64] = &years[0..2]; let nineties: [i64] = &years[2..4]; Re 阅读全文
posted @ 2024-04-17 16:13 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Here is a component which doesn't need to use useEffect export function LocalTodos() { const [todos, setTodos] = useState([]) useEffect(() => { const 阅读全文
posted @ 2024-04-08 14:54 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: The component using useEffect which is not necessary: function TopicEditor({ selectedTopicId }) { const [enteredNote, setEnteredNote] = useState(''); 阅读全文
posted @ 2024-04-08 14:49 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: struct VecMetadata { first_elem_index: usize, length: usize, capacity: usize } struct SliceMetadata { first_elem_index: usize, length: usize } Slice i 阅读全文
posted @ 2024-04-08 14:20 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: The following code will have borrowing problem fn print_years(years: Vec<i32>) { for year in years.iter() { println!("Year: {}", year); } } // dealloc 阅读全文
posted @ 2024-04-08 01:24 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: function freeze(config?: { unless: () => boolean }) { return function(target: any, propertyKey: string) { let value: any; const getter = function () { 阅读全文
posted @ 2024-04-07 17:14 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Mutate the Vec: fn vec_loop(mut v: Vec<i32>) -> Vec<i32> { for element in v.iter_mut() { // Fill this up so that each element in the Vec `v` is // mul 阅读全文
posted @ 2024-04-03 02:20 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Intro to Array.prototype.with(index, value) const ages = [10, 15, 20, 25]; const newAges = ages.with(1, 16); console.log(newAges); // [10, 16, 20, 25] 阅读全文
posted @ 2024-03-26 15:28 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
摘要: Example 1: trait AppendBar { fn append_bar(self) -> Self; } impl AppendBar for String { fn append_bar(mut self) -> Self { self.push_str("Bar"); return 阅读全文
posted @ 2024-03-23 17:47 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 467 下一页