subnet qol#59
Open
michaeldjeffrey wants to merge 3 commits into
Open
Conversation
| fs::create_dir_all(parent)?; | ||
|
|
||
| let do_write = |msg: String| -> Result<Msg> { | ||
| if let Some(parent) = args.out_file.parent() { |
Contributor
There was a problem hiding this comment.
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()) |
Contributor
There was a problem hiding this comment.
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?
Contributor
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces Org
DevaddrConstraintwithDevaddrSubnetto print CIDR subnet.{ "org": { "oui": 1, "owner": "13tyMLKRFYURNBQqLSqNJg9k41maP1A7Bh8QYxR13oWv7EnFooc", "payer": "112qB3YaH5bZkCnKA5uRH7tBtGNv2Y5B4smv1jsmvGUzgKT71QpE", "delegate_keys": [ "112qB3YaH5bZkCnKA5uRH7tBtGNv2Y5B4smv1jsmvGUzgKT71QpE" ], "locked": false }, "net_id": "000024", "devaddr_constraints": [ { "range": { "start_addr": "48000000", "end_addr": "480003FF" }, "subnets": [ "48000000/22" ] } ] }