diff options
| author | Carlos Maiolino <[email protected]> | 2026-02-20 16:17:14 +0100 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2026-02-20 16:17:14 +0100 |
| commit | 4ff0e42f65d8bba3d21bed53bfe1251d8db5c13f (patch) | |
| tree | 9ac61873e2676c3f392bd26063afeb16897c3902 /rust/findurl/src | |
| parent | fd313dd5ad9ac067a31f2b1760b85bd305567131 (diff) | |
Diffstat (limited to 'rust/findurl/src')
| -rw-r--r-- | rust/findurl/src/furl.rs | 7 | ||||
| -rw-r--r-- | rust/findurl/src/main.rs | 27 |
2 files changed, 34 insertions, 0 deletions
diff --git a/rust/findurl/src/furl.rs b/rust/findurl/src/furl.rs new file mode 100644 index 0000000..5ce60c1 --- /dev/null +++ b/rust/findurl/src/furl.rs @@ -0,0 +1,7 @@ +pub fn find_urls(urls: &mut Vec<String>) -> () { + + urls.push("Ronaldo".to_string()); + for i in urls { + println!("{i}"); + } +} diff --git a/rust/findurl/src/main.rs b/rust/findurl/src/main.rs new file mode 100644 index 0000000..1723df4 --- /dev/null +++ b/rust/findurl/src/main.rs @@ -0,0 +1,27 @@ +mod furl; + +fn main() { + let mut s = String::new(); + + loop { + + match std::io::stdin().read_line(&mut s) { + Ok(n) => { + if n == 0 { + break; + } + } + Err(_) => panic!(), + } + } + + let mut urls: Vec<String> = Vec::new(); + + furl::find_urls(&mut urls); + + for i in &urls { + println!("{i}"); + } + + println!("{}", s); +} |
