Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

Run on Rust stable. #3

Merged
merged 1 commit into from
Jul 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
language: rust
rust: nightly
rust:
- nightly
- beta
- stable
script:
- cargo test
- cargo build
- "if [ $TRAVIS_RUST_VERSION = nightly ]; then cargo test; fi"
- cargo doc
after_success:
- curl https://raw.githubusercontent.com/kmcallister/travis-doc-upload/master/travis-doc-upload.sh | sh
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ repository = "https://github.com/servo/futf"
description = "Handling fragments of UTF-8"

[dependencies]
mac = "0"
mac = "0.0"
debug_unreachable = "0.0"
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(core_intrinsics)]
#![cfg_attr(test, feature(test, str_char, slice_bytes))]

#[macro_use]
extern crate debug_unreachable;

#[macro_use]
extern crate mac;

#[cfg(test)]
extern crate test as std_test;

use std::{slice, char, intrinsics};
use std::{slice, char};

/// Meaning of a complete or partial UTF-8 codepoint.
///
Expand Down Expand Up @@ -131,7 +133,7 @@ unsafe fn decode(buf: &[u8]) -> Option<Meaning> {
| ((*buf.get_unchecked(3) & 0x3F) as u32);
if n < 0x1_0000 { return None } // Overlong
}
_ => intrinsics::unreachable(),
_ => debug_unreachable!(),
}

char::from_u32(n).map(Meaning::Whole)
Expand Down