All Projects → kornelski → rust-file

kornelski / rust-file

Licence: other
Trivial 1-liner for reading files

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to rust-file

TataruHelper
Tataru Helper - application for translation of in-game texts in Japan MMORPG - Final Fantasy XIV. The texts are understood as MSQ, cutscenes, quests, NPC replicas, etc.
Stars: ✭ 255 (+1600%)
Mutual labels:  helper
nest-abstract
NestJs Abstraction Helper
Stars: ✭ 36 (+140%)
Mutual labels:  helper
RaycastVisualization
This asset allows users to view raycasts as the user fires them.
Stars: ✭ 61 (+306.67%)
Mutual labels:  helper
cfw-easy-utils
An in-depth library to assist with common tasks with CF Workers. Includes utils for responses, cookies, and more!
Stars: ✭ 52 (+246.67%)
Mutual labels:  helper
csshelper
CSS helper, forget traditional css frameworks approach, every class is a task-like
Stars: ✭ 14 (-6.67%)
Mutual labels:  helper
IDCardNumber-Validator
An Objective-C & Swift implementation to (check) validate Chinese ID Card No. 身份证号码验证
Stars: ✭ 15 (+0%)
Mutual labels:  helper
SettingsUI
Windows 11 settings page in WinUI 3 applications ported from Powertoys
Stars: ✭ 95 (+533.33%)
Mutual labels:  helper
hubot-suggest
Suggest hubot commands when not found
Stars: ✭ 29 (+93.33%)
Mutual labels:  helper
sendmessage
SendMessage is a little tool to send Windows messages to any window.
Stars: ✭ 93 (+520%)
Mutual labels:  helper
git-cheatsheet
One stop guide to help solve all your doubts related to Git & GitHub.
Stars: ✭ 31 (+106.67%)
Mutual labels:  helper
PREBorderView
A very simple Objective-C UIView category for specifying single-sided borders.
Stars: ✭ 18 (+20%)
Mutual labels:  helper
MagicaVoxel File Writer
MagicaVoxel File Writer dependency free cpp class
Stars: ✭ 26 (+73.33%)
Mutual labels:  helper
slicy
A set of typesafe chainable slice helpers to reduce pain of working with slices
Stars: ✭ 18 (+20%)
Mutual labels:  helper
permissionUtil
Simple permission helper
Stars: ✭ 64 (+326.67%)
Mutual labels:  helper
DevExpress4Delphi
Class helper for DevExpress components
Stars: ✭ 22 (+46.67%)
Mutual labels:  helper
craft-helper
A collection of useful Craft CMS macros and components.
Stars: ✭ 23 (+53.33%)
Mutual labels:  helper
ideas
Идеи по улучшению языка C++ для обсуждения
Stars: ✭ 65 (+333.33%)
Mutual labels:  helper
tilegrinder
♻️ A node.js GIS helper library for easy alteration of Vector Tiles in an MBTiles container
Stars: ✭ 64 (+326.67%)
Mutual labels:  helper
aws-mobilehub-helper-ios
ARCHIVED: Use https://github.com/aws/aws-sdk-ios/
Stars: ✭ 41 (+173.33%)
Mutual labels:  helper
UCAS-Helper
国科大(UCAS, ucas)校园网登录、课程资源下载、自动评教和分数查询助手
Stars: ✭ 105 (+600%)
Mutual labels:  helper

File I/O 1-liners for old Rust

This crate is obsolete since Rust 1.26. If you have a file-related Rust project and would like to use this crate name, let me know!

Vec<u8>

file::get() and file::put() — read and write Vec<u8> with one function call on Rust before 1.26.

Use std::fs::read("path")? and std::fs::write("path", data)? in Rust 1.26 or later.

extern crate file;

fn example() -> file::Result<()> {
    let data = file::get("some_input_file.dat")?;
    file::put("a.out", &data)?;
    Ok(())
}

file::Result is an alias for std::io::Result. You can use Result<(), Box<std::error::Error>> in places where you don't want to expose the error type.

String

file::get_text() and file::put_text() — read and write String with one function call.

Use std::fs::read_to_string("path")? and and std::fs::write("path", string)? in Rust 1.26 or later.

extern crate file;

fn example() -> file::Result<()> {
    let string = file::get_text("hello.txt")?;
    file::put_text("bye.txt", &string)?;
    Ok(())
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].