Skip to content

Change simple code in book#1698

Merged
josh-audio merged 4 commits intolinebender:masterfrom
ccqpein:master
Apr 5, 2021
Merged

Change simple code in book#1698
josh-audio merged 4 commits intolinebender:masterfrom
ccqpein:master

Conversation

@ccqpein
Copy link
Contributor

@ccqpein ccqpein commented Apr 5, 2021

In Get started with Druid of book, the simple code:

fn main() -> Result<(), PlatformError> {
    AppLauncher::with_window(WindowDesc::new(build_ui)).launch(())?;
    Ok(())
}

doesn't pass the compiler. Change it to:

fn main() -> Result<(), PlatformError> {
    AppLauncher::with_window(WindowDesc::new(build_ui())).launch(())?;
    Ok(())
}

will work


### Docs

- Fix example code in `Get started with Druid` chapter of book ([#1698] by [@ccqpein])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add to the list of links at the bottom of the file for the [#1698] and [@ccqpein] shortcuts to work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for notifying me, let me change it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just done. Please check it out.

@josh-audio
Copy link
Collaborator

josh-audio commented Apr 5, 2021

Thanks! I'll merge this tomorrow morning if there are no other comments.

@josh-audio josh-audio merged commit 5138e8b into linebender:master Apr 5, 2021
@memoryruins
Copy link

This change causes the example code to no longer compile with 0.7, although the book instructs the user to use 0.7 right above the example. New users have ran into this on discord.

I realize users of master branch can run into this without this change #1637, but the book doesn't currently specify using a git version. Should this be reverted?

@josh-audio
Copy link
Collaborator

Based on this Zulip conversation, I've opened a PR (#1732) to update the book to use the latest git version. This was an oversight when I reviewed this PR. Sorry for the confusion it caused!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants