Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse builder pattern with RequestInit #22427
Comments
|
It could be a great way to learn the Builder pattern in Rust for me. Can I work on it? |
|
Sure! Look for uses of |
|
@highfive: assign me |
|
Hey @lucasfantacuci! Thanks for your interest in working on this issue. It's now assigned to you! |
|
@jdm I was analyzing the code from components and I couldn't realize what are all the mandatory arguments. I can't be sure. |
|
I recommend starting from the specification definition of a request (https://fetch.spec.whatwg.org/#concept-request) - anything that says "unless otherwise set" or "unless stated otherwise" is optional, so anything without that is mandatory. Then try to match the mandatory ones against the members of RequestInit. |
…nit, r=<try> [WIP]Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x ] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm,KiChjang Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm,KiChjang Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
…nit, r=jdm,KiChjang Refactoring RequestInit to use a Builder Pattern <!-- Please describe your changes on the following line: --> If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22427 - [x] These changes do not require tests because it is a code refactoring. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22521) <!-- Reviewable:end -->
If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like https://html.spec.whatwg.org/multipage/media.html#media-elements.