✨ initial code #1
Just some notes, the rest looks fine.
@ -0,0 +1,53 @@
///OpensatargetfileorURLusingtheappropriateplatform-specificopener.
I don't know why but somehow I don't like the variable assignment.
Unfortunately I don't know how to write it cleaner without introducing another function. Here is my idea, but I'm not sure whether it's better.
fn apply(func: fn(a: A) -> R, a: A) -> A {
func(a)
}
pub fn open(target: String) {
get_platform_opener()
|> opener_to_exec()
|> apply([target])
}
It would be amazing to be able to capture the function as an argument like below. But this doesn't seem to work...
|> _([target])
Just a note: Linux and Darwin are Kernels, but the Win32 Kernel would be NT.
@ -0,0 +49,4 @@
{Port, {exit_status, Code}} ->
port_close(Port),
{error, {Code, list_to_binary(lists:reverse(Acc))}}
end.
This looks rather magic to me. Maybe a comment would be good here.
@ -0,0 +1,53 @@
///OpensatargetfileorURLusingtheappropriateplatform-specificopener.
fixed!
@ -0,0 +49,4 @@
{Port, {exit_status, Code}} ->
port_close(Port),
{error, {Code, list_to_binary(lists:reverse(Acc))}}
end.
I added a comment
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?