Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

gio:File::parse_name conflict #502

Closed
pbor opened this issue May 3, 2021 · 4 comments · Fixed by #505
Closed

gio:File::parse_name conflict #502

pbor opened this issue May 3, 2021 · 4 comments · Fixed by #505
Milestone

Comments

@pbor
Copy link
Contributor

pbor commented May 3, 2021

In C we have get_parse_name() and parse_name() constructor.

As far as I can see in rust both are called parse_name one must specify the trait to disambiguate

@sdroege
Copy link
Member

sdroege commented May 4, 2021

The constructor should really be from_parse_name(). CC @fengalin @bilelmoussaoui

@sdroege sdroege added this to the 0.14.0 milestone May 4, 2021
@sdroege sdroege added the gio label May 4, 2021
@pbor
Copy link
Contributor Author

pbor commented May 4, 2021

In general I would agree... but parse is a verb so the whole api is kind of weird.

Another possibility is to drop the getter entirely and implement Display.
Implementing Display is a good idea on its own, so in the mean time I opened #503

@sdroege
Copy link
Member

sdroege commented May 4, 2021

In GFile there's a concept of a "parse name", so I wouldn't consider it as a verb here.

@fengalin
Copy link
Contributor

fengalin commented May 4, 2021

The constructor should really be from_parse_name().

I agree, this is a File constructor, not a Path name parser.

While we're at it, we should also probably rename other constructors:

  • new_for_commandline_arg.
  • new_for_commandline_arg_and_cwd.
  • new_for_path.
  • new_for_uri.

... either to for_* or from_*. Kind of weird they didn't get caught by the constructor auto-renaming stuff btw.

Edit: as it turns out, the functions are not declared as constructors in Gir.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants