Skip to content

Commit

Permalink
Auto-merge for PR #107 via VersionBot
Browse files Browse the repository at this point in the history
Transitioning to CircleCI and running latest clippy and rustfmt
  • Loading branch information
resin-io-modules-versionbot[bot] authored Jan 10, 2018
2 parents 054da00 + 2f66861 commit 403d89f
Show file tree
Hide file tree
Showing 18 changed files with 312 additions and 319 deletions.
41 changes: 41 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

build: &build
docker:
- image: majorz/rust-$CIRCLE_JOB:rust-1.23.0
steps:
- checkout
- run: cargo build

version: 2

jobs:
aarch64:
<<: *build
rpi:
<<: *build
armv7hf:
<<: *build
i386:
<<: *build
amd64:
<<: *build
test:
docker:
- image: majorz/rust-test-deploy:rust-nightly-2018-01-08
steps:
- checkout
- run: cargo fmt -- --write-mode=diff
- run: cargo clippy -- -D warnings

workflows:
version: 2
test:
jobs:
- test
build:
jobs:
- aarch64
- rpi
- armv7hf
- i386
- amd64
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
28 changes: 4 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
dist: trusty
sudo: required
language: rust
cache: cargo
rust:
- nightly
- beta
- stable
before_install:
- sudo apt-get -qq update
- sudo apt-get install -yq --no-install-recommends libdbus-1-dev
install:
- type -p cargo-install-update || cargo install cargo-update
- cargo install-update -i cargo-update
- cargo install-update -i rustfmt
- if [ $TRAVIS_RUST_VERSION == nightly ]; then
cargo install-update -i clippy;
fi
script:
- cargo fmt -- --write-mode=diff
- if [ $TRAVIS_RUST_VERSION == nightly ]; then
cargo clippy -- -D warnings;
fi
- cargo build
language: generic
script: printf 'empty'
notifications:
email: false
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).

## v0.8.3 - 2018-01-10

* Transitioning to CircleCI and running latest clippy and rustfmt #107 [majorz]

## v0.8.2 - 2017-10-20

* Do not include clippy as an optional dependency #100 [majorz]
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "network-manager"
version = "0.8.2"
version = "0.8.3"
authors = ["Joseph Roberts <[email protected]>", "Zahari Petkov <[email protected]>"]
description = "Rust NetworkManager bindings"
homepage = "https://github.com/resin-io-modules/network-manager"
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
network-manager
==============
===============

[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/resin-io-modules/NetworkManager/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/resin-io-modules/network-manager.svg?branch=master)](https://travis-ci.org/resin-io-modules/network-manager)
> Rust NetworkManager bindings
[![Current Release](https://img.shields.io/github/release/resin-io-modules/network-manager.svg?style=flat-square)](https://github.com/resin-io-modules/network-manager/releases/latest)
[![CircleCI status](https://img.shields.io/circleci/project/github/resin-io-modules/network-manager.svg?style=flat-square)](https://circleci.com/gh/resin-io-modules/network-manager)
[![License](https://img.shields.io/github/license/resin-io-modules/network-manager.svg?style=flat-square)](https://github.com/resin-io-modules/network-manager/blob/master/LICENSE)
[![Issues](https://img.shields.io/github/issues/resin-io-modules/network-manager.svg?style=flat-square)](https://github.com/resin-io-modules/network-manager/issues)

<div align="center">
<sub>an open source :satellite: project by <a href="https://resin.io">resin.io</a></sub>
</div>

***

Support
-------

If you're having any problem, please [raise an issue](https://github.com/resin-io-modules/network-manager/issues/new) on GitHub or [contact us](https://resin.io/community/), and the resin.io team will be happy to help.

***

License
-------

network-manager is free software, and may be redistributed under the terms specified in
the [license](https://github.com/resin-io-modules/network-manager/blob/master/LICENSE).
3 changes: 1 addition & 2 deletions examples/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ extern crate network_manager;
use std::env;
use std::process;

use network_manager::{NetworkManager, DeviceType};

use network_manager::{DeviceType, NetworkManager};

fn main() {
let args: Vec<String> = env::args().collect();
Expand Down
13 changes: 4 additions & 9 deletions examples/hotspot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ extern crate network_manager;
use std::env;
use std::process;

use network_manager::{NetworkManager, Device, DeviceType};

use network_manager::{Device, DeviceType, NetworkManager};

struct Options {
interface: Option<String>,
ssid: String,
password: Option<String>,
}


fn print_usage_and_exit() {
println!("USAGE: hotspot [-i INTERFACE] SSID [PASSWORD]");
process::exit(1);
}


fn parse_options() -> Options {
let args: Vec<String> = env::args().collect();

Expand Down Expand Up @@ -51,7 +48,6 @@ fn parse_options() -> Options {
}
}


fn find_device(manager: &NetworkManager, interface: Option<String>) -> Option<Device> {
if let Some(interface) = interface {
let device = manager.get_device_by_interface(&interface).unwrap();
Expand All @@ -64,9 +60,9 @@ fn find_device(manager: &NetworkManager, interface: Option<String>) -> Option<De
} else {
let devices = manager.get_devices().unwrap();

let index = devices.iter().position(
|d| *d.device_type() == DeviceType::WiFi,
);
let index = devices
.iter()
.position(|d| *d.device_type() == DeviceType::WiFi);

if let Some(index) = index {
Some(devices[index].clone())
Expand All @@ -76,7 +72,6 @@ fn find_device(manager: &NetworkManager, interface: Option<String>) -> Option<De
}
}


fn main() {
let Options {
interface,
Expand Down
9 changes: 0 additions & 9 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
array_layout = "Block"
chain_indent = "Block"
control_style = "Rfc"
fn_args_layout = "Block"
fn_args_paren_newline = false
fn_call_style = "Block"
fn_call_width = 80
match_block_trailing_comma = true
struct_lit_multiline_style = "ForceMulti"
struct_lit_style = "Block"
use_try_shorthand = true
Loading

0 comments on commit 403d89f

Please sign in to comment.