-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
As a result of some deprecation strife, Android Gradle Plugin has forced me to write code that looks like this:
private fun <T> disableTestsForVariant(variant: T) where
T : HasUnitTestBuilder,
T : HasAndroidTestBuilder {
variant.enableAndroidTest = false
variant.enableUnitTest = false
}This is the formatted result from ktfmt, and I think it could use some reorganization although I have no strong opinions on how it should look. As a data point, this is how it looks like in Rust (I don't think the exact style belongs in Kotlin, but it's a good place to start):
fn print_embedded_urls<F>(iterator: Iter<'_, Tweet>, filter: F)
where
F: FnMut(&Url) -> bool,
{
iterator
.map(|status| &status.entities)
.flat_map(|entities| &entities.urls)
.filter_map(|url| url.expanded_url.as_ref())
.flat_map(|url| Url::parse(url))
.filter(filter)
.for_each(|url| println!("{url}"));
}hick209
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request