-
-
Save stepankuzmin/e01b36285192b8d20215c7b39e67b0d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::borrow::Cow; | |
struct A<'a> { | |
geometry_column: &'a str, | |
} | |
impl<'a> A<'a> { | |
fn geometry_column_mercator(&self, flag: bool) -> Cow<str> { | |
if flag { | |
self.geometry_column.into() | |
} else { | |
String::from("Hello world!").into() | |
} | |
} | |
} | |
fn main() { | |
let a = A { | |
geometry_column: "Foo", | |
}; | |
println!("{:?}", a.geometry_column_mercator(true)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment