1 unstable release

Uses old Rust 2015

0.1.0 Mar 29, 2017

#96 in #addresses

MIT/Apache

4KB
51 lines

ip-macro

Build status Cargo

Macros for writing literal IP addresses.

See https://github.com/rust-lang/rfcs/issues/1926 for the background behind this crate.

Rust nightly

This crate uses the recently implemented procedural macros feature, and so requires a nightly version of the compiler.

If you use rustup (recommended), then you can install Rust nightly using these instructions.

Example

#![feature(proc_macro)]  // <- Don't forget this!!!

extern crate ip_macro;
use ip_macro::ip;

fn main() {
    println!("There's no place like {}", ip!("127.0.0.1"));
}

Dependencies

~1.5MB
~41K SLoC