Skip to content

Commit

Permalink
Change to use std::iter for the previous patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibi Braniecki committed Apr 19, 2019
1 parent 934dd77 commit 8a94187
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fluent-fallback/examples/simple.rs
Expand Up @@ -27,7 +27,7 @@ use std::fs;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::iter::from_fn;
use std::iter;
use std::str::FromStr;

/// We need a generic file read helper function to
Expand Down Expand Up @@ -117,7 +117,7 @@ fn main() {
let res_mgr = &resources;
let res_ids = res_ids.to_vec();

from_fn(move || {
iter::from_fn(move || {
locales.next().map(|locale| {
let mut bundle = FluentBundle::new(&[locale]);
let res_path = res_path_scheme.replace("{locale}", locale);
Expand Down
4 changes: 2 additions & 2 deletions fluent-fallback/tests/localization_test.rs
Expand Up @@ -6,7 +6,7 @@ use fluent_fallback::Localization;
use std::cell::RefCell;
use std::fs;
use std::io;
use std::iter::from_fn;
use std::iter;

fn read_file(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
Expand All @@ -25,7 +25,7 @@ fn localization_format() {
let res_mgr = &resources;
let res_ids = res_ids.to_vec();

from_fn(move || {
iter::from_fn(move || {
locales.next().map(|locale| {
let mut bundle = FluentBundle::new(&[locale]);
let res_path = res_path_scheme.replace("{locale}", locale);
Expand Down
4 changes: 2 additions & 2 deletions fluent-resmgr/src/resource_manager.rs
Expand Up @@ -2,7 +2,7 @@ use elsa::FrozenMap;
use fluent::{FluentBundle, FluentResource};
use std::fs;
use std::io;
use std::iter::from_fn;
use std::iter;

fn read_file(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
Expand Down Expand Up @@ -55,7 +55,7 @@ impl ResourceManager {
let res_mgr = self;
let mut ptr = 0;

from_fn(move || {
iter::from_fn(move || {
locales.get(ptr).map(|locale| {
ptr += 1;
let mut bundle = FluentBundle::new(&[locale]);
Expand Down

0 comments on commit 8a94187

Please sign in to comment.