mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-13 11:18:52 +08:00
Bug fixes and improvements (#1627)
* Update Copyright 2024 to 2025. * Fix the flex of .profile-cell for mobile devices. * Update performance_evaluation.md * 抛出 -> 给出 * Sync zh and zh-hant version. * Improve the landing page of the English version. * Bug fixes * Fix readme-typing-svg * Update readme-typing-svg * Bug fixes * sync zh and zh-hant versions.
This commit is contained in:
@@ -10,9 +10,15 @@ pub struct Vertex {
|
||||
pub val: i32,
|
||||
}
|
||||
|
||||
impl From<i32> for Vertex {
|
||||
fn from(value: i32) -> Self {
|
||||
Self { val: value }
|
||||
}
|
||||
}
|
||||
|
||||
/* 輸入值串列 vals ,返回頂點串列 vets */
|
||||
pub fn vals_to_vets(vals: Vec<i32>) -> Vec<Vertex> {
|
||||
vals.into_iter().map(|val| Vertex { val }).collect()
|
||||
vals.into_iter().map(|val| val.into()).collect()
|
||||
}
|
||||
|
||||
/* 輸入頂點串列 vets ,返回值串列 vals */
|
||||
|
||||
Reference in New Issue
Block a user