-
Notifications
You must be signed in to change notification settings - Fork 3
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
subnet qol #59
base: main
Are you sure you want to change the base?
subnet qol #59
Conversation
fs::create_dir_all(parent)?; | ||
|
||
let do_write = |msg: String| -> Result<Msg> { | ||
if let Some(parent) = args.out_file.parent() { |
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.
Shouldn’t this be if let None
why would you need to create all the directories in the supplied path if it already exists?
let constraints: Vec<DevaddrConstraint> = res | ||
.devaddr_constraints | ||
.into_iter() | ||
.map(|d| d.into()) |
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.
Can you do this conversion to a subnet in a single map like with .map(|d| d.into::<DevAddrConstraint>().to_subnet()
and avoid the second iteration?
Does the description need updated? It looks like the output is going to include a subnet cidr notation address within the constraints object but the code looks like it matches the title in that the entire constraints field is being replaced by a subnet object |
Replaces Org
DevaddrConstraint
withDevaddrSubnet
to print CIDR subnet.