Commit a3ab0594 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Merge branch 'ci-anyhow' into 'master'

Update Ci and replace failure

See merge request !12
parents b4181e11 a8dbc27d
Pipeline #184225 passed with stage
in 18 minutes and 19 seconds
include:
- project: 'gnome/citemplates'
file: 'flatpak/flatpak-ci-initiative-sdk-extensions.yml'
file: 'flatpak/flatpak_ci_initiative.yml'
flatpak:
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master'
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:3.36'
variables:
BUNDLE: "icon-library-nightly.flatpak"
MANIFEST_PATH: "build-aux/org.gnome.design.IconLibraryDevel.json"
......
......@@ -8,6 +8,11 @@ dependencies = [
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "anyhow"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "atk"
version = "0.8.0"
......@@ -47,26 +52,6 @@ name = "autocfg"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "backtrace"
version = "0.3.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace-sys"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "1.2.1"
......@@ -136,26 +121,6 @@ dependencies = [
"termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "failure"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "failure_derive"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "futures-channel"
version = "0.3.4"
......@@ -424,8 +389,8 @@ dependencies = [
name = "icon-library"
version = "0.0.6"
dependencies = [
"anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
"dbus 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gettext-rs 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -646,11 +611,6 @@ name = "regex-syntax"
version = "0.6.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-demangle"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ryu"
version = "1.0.2"
......@@ -744,17 +704,6 @@ dependencies = [
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "synstructure"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termcolor"
version = "1.1.0"
......@@ -815,12 +764,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
"checksum anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f"
"checksum atk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "444daefa55f229af145ea58d77efd23725024ee1f6f3102743709aa6b18c663e"
"checksum atk-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e552c1776737a4c80110d06b36d099f47c727335f9aaa5d942a72b6863a8ec6f"
"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
"checksum backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8"
"checksum backtrace-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ca797db0057bae1a7aa2eef3283a874695455cecf08a43bfb8507ee0ebc1ed69"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum cairo-rs 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "157049ba9618aa3a61c39d5d785102c04d3b1f40632a706c621a9aedc21e6084"
"checksum cairo-sys-rs 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff65ba02cac715be836f63429ab00a767d48336efc5497c5637afb53b4f14d63"
......@@ -829,8 +777,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2"
"checksum dbus 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2fd043051adb767dd40f869e6034c8ea4d3a0a719e78d4058f705a8038649059"
"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
"checksum failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b"
"checksum failure_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231"
"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8"
"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a"
"checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba"
......@@ -878,7 +824,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
"checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8"
"checksum regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8"
"checksum search-provider 0.1.0 (git+https://gitlab.gnome.org/World/Rust/search-provider.git)" = "<none>"
"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449"
......@@ -888,7 +833,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum sourceview4 0.2.0 (git+https://gitlab.gnome.org/World/Rust/sourceview4-rs.git?rev=fa8819fa7ecbe56f44d951656d3825f468915754)" = "<none>"
"checksum sourceview4-sys 0.2.0 (git+https://gitlab.gnome.org/World/Rust/sourceview4-rs.git?rev=fa8819fa7ecbe56f44d951656d3825f468915754)" = "<none>"
"checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859"
"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545"
"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
......
......@@ -19,8 +19,8 @@ serde_derive = "1.0"
pretty_env_logger = "0.3"
dbus = "0.8"
search-provider = { git = "https://gitlab.gnome.org/World/Rust/search-provider.git" }
failure = "0.1"
gtk-macros = "0.2"
anyhow = "1.0"
[dependencies.sourceview4]
git = "https://gitlab.gnome.org/World/Rust/sourceview4-rs.git"
......
{
"app-id": "org.gnome.design.IconLibraryDevel",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"runtime-version": "3.36",
"sdk": "org.gnome.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable"
......
......@@ -2,7 +2,7 @@ use crate::config;
use crate::models::{Icon, IconsModel};
use crate::search_provider::SearchProvider;
use crate::widgets::{ExportDialog, Window};
use failure::Error;
use anyhow::Result;
use gio::prelude::*;
use glib::Receiver;
use gtk::prelude::*;
......@@ -21,7 +21,7 @@ pub struct Application {
}
impl Application {
pub fn new() -> Result<Self, Error> {
pub fn new() -> Result<Self> {
let app = gtk::Application::new(Some(config::APP_ID), Default::default())?;
let (sender, r) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
let receiver = RefCell::new(Some(r));
......
......@@ -6,6 +6,7 @@ extern crate glib;
extern crate serde_derive;
#[macro_use]
extern crate gtk_macros;
use anyhow::Result;
use gettextrs::*;
use std::rc::Rc;
......@@ -20,7 +21,7 @@ mod window_state;
use application::Application;
use config::{GETTEXT_PACKAGE, LOCALEDIR, NAME_PREFIX};
fn main() -> Result<(), failure::Error> {
fn main() -> Result<()> {
pretty_env_logger::init();
gtk::init()?;
......
use crate::config;
use dbus::arg;
use failure::Error;
use gio::prelude::*;
use gtk::prelude::*;
use serde::de;
......@@ -83,7 +82,7 @@ impl Icon {
|| self.context.to_lowercase().contains(&search_str)
}
pub fn derive(&self) -> Result<(), Error> {
pub fn derive(&self) -> anyhow::Result<()> {
let icon_file = gio::File::new_for_path(self.get_path());
// Push the icon into /tmp so other apps can access it for now. Not ideal :(
let mut dest = std::env::temp_dir();
......@@ -101,7 +100,7 @@ impl Icon {
Ok(())
}
pub fn save(&self, destination: &gio::File) -> Result<(), Error> {
pub fn save(&self, destination: &gio::File) -> anyhow::Result<()> {
let icon_file = gio::File::new_for_path(self.get_path());
icon_file.copy(destination, gio::FileCopyFlags::OVERWRITE, gio::NONE_CANCELLABLE, None)?;
Ok(())
......
use super::icon::Icon;
use crate::config;
use failure::Error;
use anyhow::Result;
use gtk::prelude::*;
use std::cell::RefCell;
use std::collections::BTreeMap;
......@@ -22,7 +22,7 @@ pub struct IconsModel {
}
impl IconsModel {
pub fn new() -> Result<Self, Error> {
pub fn new() -> Result<Self> {
let system_icons = RefCell::new(BTreeMap::new());
let shipped_icons = RefCell::new(BTreeMap::new());
let model = Self { system_icons, shipped_icons };
......@@ -74,14 +74,14 @@ impl IconsModel {
.collect()
}
fn init(&self) -> Result<(), Error> {
fn init(&self) -> Result<()> {
self.init_shipped_icons()?;
self.init_system_icons()?;
Ok(())
}
fn init_shipped_icons(&self) -> Result<(), Error> {
fn init_shipped_icons(&self) -> Result<()> {
let dev_kit_file: PathBuf = [config::PKGDATADIR, "icons_dev_kit.json"].iter().collect();
let file = File::open(dev_kit_file)?;
let reader = BufReader::new(file);
......@@ -103,7 +103,7 @@ impl IconsModel {
Ok(())
}
fn init_system_icons(&self) -> Result<(), Error> {
fn init_system_icons(&self) -> Result<()> {
// Load default theme icons
let theme = gtk::IconTheme::get_default().unwrap();
let legacy_contexts = vec!["Legacy"];
......
use failure::Error;
use anyhow::Result;
use gio::prelude::SettingsExt;
use gtk::prelude::GtkWindowExt;
use gtk::SettingsExt as gtkSettingsExt;
......@@ -28,7 +28,7 @@ pub fn load(window: &gtk::ApplicationWindow, settings: &gio::Settings) {
}
}
pub fn save(window: &gtk::ApplicationWindow, settings: &gio::Settings) -> Result<(), Error> {
pub fn save(window: &gtk::ApplicationWindow, settings: &gio::Settings) -> Result<()> {
let size = window.get_size();
let position = window.get_position();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment