Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten paths and modernize imports #137

Merged
merged 2 commits into from
May 6, 2021
Merged

Conversation

ratijas
Copy link
Collaborator

@ratijas ratijas commented Apr 27, 2021

Most noticeably, std::ffi::CStr[ing] and ::std::os::raw::c_void.


Just a clean-up, because I needed QMetaType in a good shape.

The more I play with QVariant implementations, the more I think QMetaType belongs to qttypes crate. I can not justify that they are not split in different packages.

@ratijas
Copy link
Collaborator Author

ratijas commented Apr 27, 2021

This is already turning out bigger than anticipated 😅

@ratijas
Copy link
Collaborator Author

ratijas commented Apr 27, 2021

@ogoffart Do you like it more this way? Looks simple and sparse to me. Very copy-pastable for a reader.
20210427_171827

It currently lacks my favorite "wrapper around" and links boilerplate, but that's a different topic.

@ogoffart
Copy link
Member

TBH i liked it better before (with the full path in the code). But that's not so important.

* Most noticeably, shortened std::ffi::CStr[ing] and ::std::os::raw::c_void.
* (qmetaobject/src/scenegraph.rs):
  - Removed probably misplaced #[cfg(qt_5.8)] attribute before use super::*;
  - Fixed indentation in screnegraph, because cargo fmt could be wrong when
    it comes to  macros.
@ratijas ratijas force-pushed the shorten-uses branch 2 times, most recently from f641d1d to 4c1e8a8 Compare April 27, 2021 16:04
@ratijas
Copy link
Collaborator Author

ratijas commented Apr 27, 2021

Ahem… So… Not sure it was worth it in case of cpp! in every file, but oh well. Here it goes.

@ratijas ratijas changed the title shorten paths: factor out extra double-colons to imports Shorten paths and modernize imports Apr 27, 2021
@ratijas
Copy link
Collaborator Author

ratijas commented Apr 28, 2021

Just a little tiny whitespace nit while I'm at it. Now I consider it done, although I've almost sure missed something. And that's why I'm genuinely uncomfortable with merging it without an approval. There is no rush though. Take your time.

@ratijas
Copy link
Collaborator Author

ratijas commented May 4, 2021

One week was just about enough, I think. Gotta review myself and merge it tomorrow, if no concerns will be raised in the process or by that time.

Replaces all `extern crate ...` and especially #[macro_use] statements
with direct `use`s of relevant items.

Introduces cstr! crate & macro to examples, because we don't want our dear
users/readers to suffer with raw CStr nightmare:
    std::ffi::CStr::from_bytes_with_nul(b"...\0").unwrap()
@ratijas
Copy link
Collaborator Author

ratijas commented May 5, 2021

Shortened more paths, especially in tests. Removed some strange std stuff, such as std::string::String and use std::iter::Iterator;

@ratijas
Copy link
Collaborator Author

ratijas commented May 6, 2021

CI is freaking out. Retrying.

@ratijas ratijas merged commit c6ecbcd into woboq:master May 6, 2021
@ratijas
Copy link
Collaborator Author

ratijas commented May 6, 2021

Done and done. Now, back to QVariant and QMetaType at #136.

@ratijas ratijas deleted the shorten-uses branch May 6, 2021 07:51
@ratijas ratijas added A-docs Area: documentation for any part of the projects C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the projects C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants