Skip to content

Commit

Permalink
Merge pull request #24 from Juanperias/juanperias-fix-docs
Browse files Browse the repository at this point in the history
Change bad info in docs
  • Loading branch information
Juanperias authored Nov 1, 2024
2 parents be8a1ed + dcec2a7 commit e2e1c20
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "motion"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
authors = ["Juanperias"]
description = "A bare metal physics engine."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ let's start by making a simple event loop
```rust
use std::{thread, time::Duration};

use motion::event_loop::{EventLoop, EventLoopConfig};
use motion::event_loop::EventLoopBuilder;

// The definition of this function depends on the context in which motion is used
fn sleep(duration: Duration) {
thread::sleep(duration);
}

fn main() {
let el = EventLoop::new(EventLoopConfig { fps: 1 });
let el = EventLoopBuilder::new().fps(1).build();

el.start(|_config| println!("Hello! in the event loop"), sleep);
}
Expand Down
2 changes: 1 addition & 1 deletion src/forces/force.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::obj::obj_2d::Object2d;
/// struct Gravity;
///
/// impl Force for Gravity {
/// fn apply_2d(&self, obj: &mut Object2d) {
/// fn apply_2d(&mut self, obj: &Object2d) {
/// // Apply gravitational force to obj
/// }
/// }
Expand Down
11 changes: 7 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
//! With this you already have record installed in your project, you can start with a simple event loop
//!```rust
//!use std::{thread, time::Duration};
//!use motion::event_loop::{EventLoop, EventLoopConfig};
//! // The definition of this function depends on the context in which motion is used
//!
//!use motion::event_loop::EventLoopBuilder;
//!
// The definition of this function depends on the context in which motion is used
//!fn sleep(duration: Duration) {
//! thread::sleep(duration);
//! thread::sleep(duration);
//!}
//!
//!fn main() {
//! let el = EventLoop::new(EventLoopConfig { fps: 1 });
//! let el = EventLoopBuilder::new().fps(1).build();
//!
//! el.start(|_config| println!("Hello! in the event loop"), sleep);
//!}
Expand Down

0 comments on commit e2e1c20

Please sign in to comment.