shadowninja / mt_media_collector Goto Github PK
View Code? Open in Web Editor NEWCollects assets for a Minetest HTTP asset server and creates an index.mth file for those assets.
License: MIT License
Collects assets for a Minetest HTTP asset server and creates an index.mth file for those assets.
License: MIT License
Still trying to understand/fix this for myself (never done Rust before), but in the meantime I am having a build problem on Ubuntu 16.04, with a freshly installed cargo
from repo:
$ cargo build
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading rust-ini v0.9.8
Downloading log v0.3.6
Downloading getopts v0.2.14
Downloading sha1 v0.2.0
Compiling getopts v0.2.14
Compiling log v0.3.6
Compiling sha1 v0.2.0
Compiling rust-ini v0.9.8
Compiling mt_media_collector v0.1.0 (file:///home/tai/gitprojects/mt_media_collector)
src/main.rs:160:18: 165:3 error: match arms have incompatible types:
expected `fn(_, _) -> core::result::Result<(), std::io::error::Error> {copy_assets::symlink_file}`,
found `fn(_, _) -> core::result::Result<(), std::io::error::Error> {std::fs::hard_link}`
(expected fn item,
found a different fn item) [E0308]
src/main.rs:160 let copy_func = match mode {
src/main.rs:161 AssetCopyMode::Symlink => symlink_file,
src/main.rs:162 AssetCopyMode::Hardlink => fs::hard_link,
src/main.rs:163 AssetCopyMode::Copy => copy_no_result,
src/main.rs:164 AssetCopyMode::None => return Ok(())
src/main.rs:165 };
src/main.rs:160:18: 165:3 help: run `rustc --explain E0308` to see a detailed explanation
src/main.rs:162:30: 162:43 note: match arm with an incompatible type
src/main.rs:162 AssetCopyMode::Hardlink => fs::hard_link,
^~~~~~~~~~~~~
src/main.rs:168:8: 168:17 error: the type of this value must be known in this context
src/main.rs:168 try!(copy_func(&asset.path, path.join(to_hex(&asset.hash))));
^~~~~~~~~
src/main.rs:168:3: 168:64 note: in this expansion of try! (defined in <std macros>)
error: aborting due to 2 previous errors
Could not compile `mt_media_collector`.
On these Rust versions:
stable-x86_64-unknown-linux-gnu - rustc 1.20.0 (f3d6973f4 2017-08-27)
nightly-x86_64-unknown-linux-gnu - rustc 1.22.0-nightly (744dd6c1d 2017-09-02)
Building fails with:
error: missing fragment specifier
--> <clap_app macros>:87:47
|
87 | @ arg ( $ arg : expr ) $ modes : tt ! $ ident $ ( $ tail : tt ) * ) => {
| ^
|
= note: #[deny(missing_fragment_specifier)] on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
error: aborting due to previous error
error: Could not compile `mt_media_collector`.
A license should be added to the repository. Since it's a small project, the MIT license would be suitable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.