This commit is contained in:
Jonas Zeunert
2024-03-19 14:49:38 +01:00
commit aee7b76764
4 changed files with 1130 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/target
Generated
+1099
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
[package]
name = "Url_Test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.197", features = ["derive"] }
url = { version = "2.5.0", features = ["serde"] }
+20
View File
@@ -0,0 +1,20 @@
use serde::Deserialize;
use url::Url;
const SOME_URL: &str = "https://example.com";
#[derive(Deserialize, Debug, Clone)]
struct Foo {
pub an_url: Url,
}
fn main() {
let url1 = Url::parse("https://example.org");
let somestring: String = url_to_string(Url(SOME_URL + &Foo.an_url)).await;
println!("Hello, world!");
}
async fn url_to_string(url: &Url) -> String {
"".to_string()
}