-
Notifications
You must be signed in to change notification settings - Fork 6
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
Housekeeping #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
sorry, got swamped, will review shortly too |
There was a problem hiding this 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
.github/workflows/ci.yml
Outdated
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: taiki-e/install-action@cargo-hack |
There was a problem hiding this comment.
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
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@v2 | |
with: { tool: cargo-hack } |
build_pbf_glyphs/src/main.rs
Outdated
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)] |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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...
build_pbf_glyphs/src/main.rs
Outdated
#[command(version, author, about, long_about = None)] | ||
struct Args { | ||
/// Sets the source directory to be scanned for fonts. | ||
font_dir: String, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
build_pbf_glyphs/src/main.rs
Outdated
let overwrite = matches.is_present("OVERWRITE"); | ||
let args = Args::parse(); | ||
|
||
let font_dir = Path::new(&args.font_dir); |
There was a problem hiding this comment.
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
let overwrite = matches.is_present("OVERWRITE"); | ||
let args = Args::parse(); | ||
|
||
let font_dir = &args.font_dir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not inline these?
Bunch of minor housekeeping