Allow for other CE instance + create URL#4
Conversation
| .post(format!("https://www.godbolt.org/api/compiler/{}/compile", &compiler).as_str()) | ||
| .json(&source) | ||
| pub fn compile(client: Client, host: &str, src: String, compiler: &str, args: String) -> String { | ||
| let filters = json!( |
There was a problem hiding this comment.
Wow, this is a lot nicer. Thanks!
src/url.rs
Outdated
| }, | ||
| "options": args, | ||
| "compiler": compiler, | ||
| // "fontScale": 3.0 |
There was a problem hiding this comment.
Speaking of easy copy/pasting, I think you left this in and didn't mean to :)
There was a problem hiding this comment.
Yes, that's true. There is so much that could be fine tuned :) I can rebase and remove this line...
cb51acc to
a602080
Compare
|
rebased and pushed ! |
|
Excellent, thank you! I will merge once CI go green. |
Possible incorrect result from API #955 Returned JSON may have invalid objects. Mark the field as optional as the incorrect cases seems to appear on empty lines.
Use --host for changing the default compiler explorer.
Easier to share json with other tools if json is directly inline.
Basic support for creating an URL that points to a single code editor and using a single compiler, both provided on the command line.
Add text for --url for compile command, and refresh --help listing.
|
I've added a single commit for updating the README (very basic). |
|
Thank you so much! |
|
Thanks for merging :) For my information, how did you merge it ? Usually, merging PR maintains original commits (and authorship -- in this case, github changed the mail), but it seems that in this case all my commits were squashed before merging ? It's not really a problem in this case as it's rather small, but more by curiosity. |
|
Ok 😃 But authorship is changed. In my case, my workmail has been changed by my personnal mail. It's good to know as it can be an issue for attribution (ie. when work being contributed is paid by my employer, he wants to be credited).
|
|
Ah, well if you want I wouldn't be opposed to adding an ACKS file for acknowledgements. |
|
No no, that's fine 😃
|

This should fix #1 and #3 .
I've also took the liberty of using a different mecanism for building JSON that is sent over the POST. It had the advantage to be easily copy/pasted across the python and shell script I'm already using :D