From 312c8eb731dcb40a57b80f498a8beb6c415c90b5 Mon Sep 17 00:00:00 2001 From: alexdevteam <alexpro820@gmail.com> Date: Wed, 29 Dec 2021 15:26:14 +0100 Subject: [PATCH] Update README --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e9972d6..d5c3bba 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,12 @@ to the dependencies section of your Cargo.toml. ### Example ```rust -extern crate serialize; -extern crate tiled; - -use std::fs::File; -use std::io::BufReader; -use std::path::Path; - -use tiled::parse; +use tiled::map::Map; fn main() { - let file = File::open("assets/tiled_base64_zlib.tmx").unwrap(); - println!("Opened file"); - let reader = BufReader::new(file); - let map = parse(reader).unwrap(); + let map = Map::parse_file("assets/tiled_base64_zlib.tmx").unwrap(); println!("{:?}", map); - println!("{:?}", map.get_tileset_by_gid(22)); + println!("{:?}", map.tileset_by_gid(22)); } ``` -- GitLab