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

Housekeeping #17

Merged
merged 8 commits into from
Feb 13, 2024
Merged

Housekeeping #17

merged 8 commits into from
Feb 13, 2024

Conversation

ianthetechie
Copy link
Contributor

@ianthetechie ianthetechie commented Feb 11, 2024

Bunch of minor housekeeping

  • Update the workspace resolver
  • Add check to CI that our stated MSRV is accurate
  • Incidentally, had to bump the MSRV. I don't think it was accurate before, and it definitely wasn't after upgrades. If anyone has concerns about bumping all the way to 1.74, we could downgrade clap one minor version to get the MSRV down to 1.70. I checked Martin and it looks to already target 1.74, and internally at Stadia we target latest stable.
  • Add cargo semver checks to CI to ensure we don't accidentally break API compatibility
  • Upgrade clap (major change; I went for the derive API as it's a great fit for this use case)
  • Upgrade other dependencies, most notably freetype-rs

Copy link
Collaborator

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@nyurik
Copy link
Collaborator

nyurik commented Feb 12, 2024

sorry, got swamped, will review shortly too

Copy link
Collaborator

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, but a few nits

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-hack
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but just in case you would want to extend this, I found this syntax cleaner as it allows multiple tools

Suggested change
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@v2
with: { tool: cargo-hack }

use pbf_font_tools::freetype::{Face, Library};
use pbf_font_tools::{get_named_font_stack, glyph_range_for_face, Glyphs};
use protobuf::{CodedOutputStream, Message};
use spmc::{channel, Receiver};

static TOTAL_GLYPHS_RENDERED: AtomicUsize = AtomicUsize::new(0);

#[derive(Parser, Debug)]
#[command(version, author, about, long_about = None)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need long_about = None ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I misread the docs, apparently 😂 Removing...

#[command(version, author, about, long_about = None)]
struct Args {
/// Sets the source directory to be scanned for fonts.
font_dir: String,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to use String here - all paths are better used with PathBuf -- Clap supports them just fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh TIL Clap supports those!

let overwrite = matches.is_present("OVERWRITE");
let args = Args::parse();

let font_dir = Path::new(&args.font_dir);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you won't need to convert stuff to path if you start with PathBuf above

@ianthetechie ianthetechie merged commit 011f994 into main Feb 13, 2024
3 checks passed
@nyurik nyurik deleted the housekeeping branch February 13, 2024 01:37
let overwrite = matches.is_present("OVERWRITE");
let args = Args::parse();

let font_dir = &args.font_dir;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not inline these?

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

Successfully merging this pull request may close these issues.

3 participants